diff --git a/services/Cargo.toml b/services/Cargo.toml index 2aff991240..94f37ec02a 100644 --- a/services/Cargo.toml +++ b/services/Cargo.toml @@ -1,281 +1,6 @@ [workspace] members = [ - "mgmt/activedirectory", - "mgmt/addons", - "mgmt/adhybridhealthservice", - "mgmt/adp", - "mgmt/advisor", - "mgmt/agrifood", - "mgmt/alertsmanagement", - "mgmt/analysisservices", - "mgmt/apicenter", - "mgmt/apimanagement", - "mgmt/app", - "mgmt/appcomplianceautomation", - "mgmt/appconfiguration", - "mgmt/applicationinsights", - "mgmt/appplatform", - "mgmt/arcdata", - "mgmt/attestation", - "mgmt/authorization", - "mgmt/automanage", - "mgmt/automation", - "mgmt/baremetalinfrastructure", - "mgmt/batch", - "mgmt/billing", - "mgmt/billingbenefits", - "mgmt/blockchain", - "mgmt/blueprint", - "mgmt/botservice", - "mgmt/cdn", - "mgmt/changeanalysis", - "mgmt/chaos", - "mgmt/cloudshell", - "mgmt/cognitiveservices", - "mgmt/commerce", - "mgmt/communication", - "mgmt/compute", - "mgmt/confidentialledger", - "mgmt/confluent", - "mgmt/connectedvmware", - "mgmt/consumption", - "mgmt/containerinstance", - "mgmt/containerregistry", - "mgmt/containerstorage", - "mgmt/cosmosdb", - "mgmt/costmanagement", - "mgmt/cpim", - "mgmt/customerinsights", - "mgmt/customerlockbox", - "mgmt/customproviders", - "mgmt/dashboard", - "mgmt/data", - "mgmt/databox", - "mgmt/databoxedge", - "mgmt/databricks", - "mgmt/datacatalog", - "mgmt/datadog", - "mgmt/datafactory", - "mgmt/datalakeanalytics", - "mgmt/datalakestore", - "mgmt/datamigration", - "mgmt/dataprotection", - "mgmt/datashare", - "mgmt/deploymentmanager", - "mgmt/desktopvirtualization", - "mgmt/devcenter", - "mgmt/developerhub", - "mgmt/deviceupdate", - "mgmt/devops", - "mgmt/devspaces", - "mgmt/devtestlabs", - "mgmt/dfp", - "mgmt/digitaltwins", - "mgmt/dnc", - "mgmt/dns", - "mgmt/dnsresolver", - "mgmt/domainservices", - "mgmt/dynatrace", - "mgmt/edgeorder", - "mgmt/edgeorderpartner", - "mgmt/education", - "mgmt/elastic", - "mgmt/elasticsan", - "mgmt/engagementfabric", - "mgmt/enterpriseknowledgegraph", - "mgmt/eventgrid", - "mgmt/eventhub", - "mgmt/extendedlocation", - "mgmt/fist", - "mgmt/fluidrelay", - "mgmt/frontdoor", - "mgmt/graphservicesprod", - "mgmt/guestconfiguration", - "mgmt/hanaon", - "mgmt/hardwaresecuritymodules", - "mgmt/hdinsight", - "mgmt/healthbot", - "mgmt/healthcareapis", - "mgmt/help", - "mgmt/hybridaks", - "mgmt/hybridcloud", - "mgmt/hybridcompute", - "mgmt/hybridconnectivity", - "mgmt/hybriddatamanager", - "mgmt/hybridkubernetes", - "mgmt/hybridnetwork", - "mgmt/imagebuilder", - "mgmt/intune", - "mgmt/iotcentral", - "mgmt/iothub", - "mgmt/iotspaces", - "mgmt/keyvault", - "mgmt/kubernetesconfiguration", - "mgmt/kusto", - "mgmt/labservices", - "mgmt/liftrqumulo", - "mgmt/loadtestservice", - "mgmt/logic", - "mgmt/logz", - "mgmt/m365securityandcompliance", - "mgmt/machinelearning", - "mgmt/machinelearningcompute", - "mgmt/machinelearningexperimentation", "mgmt/machinelearningservices", - "mgmt/maintenance", - "mgmt/managednetwork", - "mgmt/managednetworkfabric", - "mgmt/managedservices", - "mgmt/managementgroups", - "mgmt/managementpartner", - "mgmt/maps", - "mgmt/mariadb", - "mgmt/marketplace", - "mgmt/marketplacecatalog", - "mgmt/marketplacenotifications", - "mgmt/marketplaceordering", - "mgmt/mediaservices", - "mgmt/migrate", - "mgmt/migrateprojects", - "mgmt/mobilenetwork", - "mgmt/monitor", - "mgmt/mpcnetworkfunction", - "mgmt/msi", - "mgmt/mysql", - "mgmt/netapp", - "mgmt/network", - "mgmt/networkcloud", - "mgmt/networkfunction", - "mgmt/newrelic", - "mgmt/nginx", - "mgmt/notificationhubs", - "mgmt/oep", - "mgmt/operationalinsights", - "mgmt/operationsmanagement", - "mgmt/orbital", - "mgmt/paloaltonetworks", - "mgmt/peering", - "mgmt/playwrighttesting", - "mgmt/policyinsights", - "mgmt/portal", - "mgmt/portalservices", - "mgmt/postgresql", - "mgmt/postgresqlhsc", - "mgmt/powerbidedicated", - "mgmt/powerbiembedded", - "mgmt/powerbiprivatelinks", - "mgmt/powerplatform", - "mgmt/privatedns", - "mgmt/professionalservice", - "mgmt/providerhub", - "mgmt/purview", - "mgmt/quantum", - "mgmt/quota", - "mgmt/recommendationsservice", - "mgmt/recoveryservices", - "mgmt/recoveryservicesbackup", - "mgmt/recoveryservicesdatareplication", - "mgmt/recoveryservicessiterecovery", - "mgmt/redhatopenshift", - "mgmt/redis", - "mgmt/redisenterprise", - "mgmt/relay", - "mgmt/reservations", - "mgmt/resourceconnector", - "mgmt/resourcegraph", - "mgmt/resourcehealth", - "mgmt/resourcemover", - "mgmt/resources", - "mgmt/riskiq", - "mgmt/saas", - "mgmt/scheduler", - "mgmt/scom", - "mgmt/scvmm", - "mgmt/search", - "mgmt/security", - "mgmt/securityandcompliance", - "mgmt/securitydevops", - "mgmt/securityinsights", - "mgmt/serialconsole", - "mgmt/servicebus", - "mgmt/servicefabricmanagedclusters", - "mgmt/servicefabricmesh", - "mgmt/servicelinker", - "mgmt/servicemap", - "mgmt/servicenetworking", - "mgmt/signalr", - "mgmt/softwareplan", - "mgmt/solutions", - "mgmt/sphere", - "mgmt/sql", - "mgmt/sqlvirtualmachine", - "mgmt/stack", - "mgmt/storage", - "mgmt/storagecache", - "mgmt/storageimportexport", - "mgmt/storagemover", - "mgmt/storagepool", - "mgmt/storagesync", - "mgmt/storagetasks", - "mgmt/storsimple1200series", - "mgmt/storsimple8000series", - "mgmt/streamanalytics", - "mgmt/subscription", - "mgmt/support", - "mgmt/synapse", - "mgmt/syntex", - "mgmt/testbase", - "mgmt/timeseriesinsights", - "mgmt/trafficmanager", - "mgmt/vi", - "mgmt/videoanalyzer", - "mgmt/visualstudio", - "mgmt/vmware", - "mgmt/vmwarecloudsimple", - "mgmt/voiceservices", - "mgmt/web", - "mgmt/webpubsub", - "mgmt/windowsesu", - "mgmt/windowsiot", - "mgmt/workloadmonitor", - "mgmt/workloads", - "svc/agrifood", - "svc/appconfiguration", - "svc/applicationinsights", - "svc/attestation", - "svc/batch", - "svc/blobstorage", - "svc/codesigning", - "svc/confidentialledger", - "svc/containerregistry", - "svc/datalakeanalytics", - "svc/devcenter", - "svc/deviceprovisioningservices", - "svc/deviceupdate", - "svc/digitaltwins", - "svc/eventgrid", - "svc/filestorage", - "svc/graphrbac", - "svc/imds", - "svc/iotcentral", - "svc/keyvault", - "svc/loadtestservice", - "svc/machinelearningservices", - "svc/marketplacecatalog", - "svc/mixedreality", - "svc/monitor", - "svc/operationalinsights", - "svc/purview", - "svc/quantum", - "svc/queuestorage", - "svc/schemaregistry", - "svc/securityinsights", - "svc/servicefabric", - "svc/storagedatalake", - "svc/synapse", - "svc/timeseriesinsights", - "svc/videoanalyzer", - "svc/webpubsub", ] resolver = "2" \ No newline at end of file diff --git a/services/mgmt/machinelearningservices/Cargo.toml b/services/mgmt/machinelearningservices/Cargo.toml index 14bfbe9f11..56891c5173 100644 --- a/services/mgmt/machinelearningservices/Cargo.toml +++ b/services/mgmt/machinelearningservices/Cargo.toml @@ -33,12 +33,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2023-06", "enable_reqwest"] +default = ["package-2023-04", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] -"package-preview-2023-06" = [] -"package-preview-2023-04" = [] -"package-preview-2023-02" = [] -"package-preview-2022-12" = [] -"package-preview-2022-10" = [] \ No newline at end of file +"package-2023-04" = [] +"package-2022-10" = [] +"package-2022-05-01" = [] +"package-2021-07-01" = [] +"package-2021-04-01" = [] \ No newline at end of file diff --git a/services/mgmt/machinelearningservices/README.md b/services/mgmt/machinelearningservices/README.md index 723693e936..af28efba16 100644 --- a/services/mgmt/machinelearningservices/README.md +++ b/services/mgmt/machinelearningservices/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/machinelea To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2023-06`. +The default tag is `package-2023-04`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: -- `package-preview-2023-06` has 209 operations from 1 API versions: `2023-06-01-preview`. Use crate feature `package-preview-2023-06` to enable. The operations will be in the `package_preview_2023_06` module. -- `package-preview-2023-04` has 206 operations from 1 API versions: `2023-04-01-preview`. Use crate feature `package-preview-2023-04` to enable. The operations will be in the `package_preview_2023_04` module. -- `package-preview-2023-02` has 195 operations from 1 API versions: `2023-02-01-preview`. Use crate feature `package-preview-2023-02` to enable. The operations will be in the `package_preview_2023_02` module. -- `package-preview-2022-12` has 166 operations from 1 API versions: `2022-12-01-preview`. Use crate feature `package-preview-2022-12` to enable. The operations will be in the `package_preview_2022_12` module. -- `package-preview-2022-10` has 166 operations from 1 API versions: `2022-10-01-preview`. Use crate feature `package-preview-2022-10` to enable. The operations will be in the `package_preview_2022_10` module. \ No newline at end of file +- `package-2023-04` has 170 operations from 1 API versions: `2023-04-01`. Use crate feature `package-2023-04` to enable. The operations will be in the `package_2023_04` module. +- `package-2022-10` has 119 operations from 1 API versions: `2022-10-01`. Use crate feature `package-2022-10` to enable. The operations will be in the `package_2022_10` module. +- `package-2022-05-01` has 115 operations from 1 API versions: `2022-05-01`. Use crate feature `package-2022-05-01` to enable. The operations will be in the `package_2022_05_01` module. +- `package-2021-07-01` has 40 operations from 1 API versions: `2021-07-01`. Use crate feature `package-2021-07-01` to enable. The operations will be in the `package_2021_07_01` module. +- `package-2021-04-01` has 41 operations from 1 API versions: `2021-04-01`. Use crate feature `package-2021-04-01` to enable. The operations will be in the `package_2021_04_01` module. \ No newline at end of file diff --git a/services/mgmt/machinelearningservices/autorust.toml b/services/mgmt/machinelearningservices/autorust.toml new file mode 100644 index 0000000000..dd2bae915e --- /dev/null +++ b/services/mgmt/machinelearningservices/autorust.toml @@ -0,0 +1,10 @@ +[tags] +# Only generate stable tags. +# They are not following the naming convension of package-date-preview. +deny_contains_preview = true +deny = [ + # duplicate "x-ms-discriminator-value": "uri_folder" with DataVersionBase + # https://github.com/Azure/azure-rest-api-specs/issues/25911 + "package-preview-2023-06", # duplicate tag https://github.com/Azure/azure-rest-api-specs/issues/16692 + "package-preview-2023-04", + ] diff --git a/services/mgmt/machinelearningservices/src/lib.rs b/services/mgmt/machinelearningservices/src/lib.rs index 20b33d1b74..d000d3bfe7 100644 --- a/services/mgmt/machinelearningservices/src/lib.rs +++ b/services/mgmt/machinelearningservices/src/lib.rs @@ -3,23 +3,23 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] -#[cfg(feature = "package-preview-2023-06")] -pub mod package_preview_2023_06; -#[cfg(all(feature = "package-preview-2023-06", not(feature = "no-default-tag")))] -pub use package_preview_2023_06::*; -#[cfg(feature = "package-preview-2023-04")] -pub mod package_preview_2023_04; -#[cfg(all(feature = "package-preview-2023-04", not(feature = "no-default-tag")))] -pub use package_preview_2023_04::*; -#[cfg(feature = "package-preview-2023-02")] -pub mod package_preview_2023_02; -#[cfg(all(feature = "package-preview-2023-02", not(feature = "no-default-tag")))] -pub use package_preview_2023_02::*; -#[cfg(feature = "package-preview-2022-12")] -pub mod package_preview_2022_12; -#[cfg(all(feature = "package-preview-2022-12", not(feature = "no-default-tag")))] -pub use package_preview_2022_12::*; -#[cfg(feature = "package-preview-2022-10")] -pub mod package_preview_2022_10; -#[cfg(all(feature = "package-preview-2022-10", not(feature = "no-default-tag")))] -pub use package_preview_2022_10::*; +#[cfg(feature = "package-2023-04")] +pub mod package_2023_04; +#[cfg(all(feature = "package-2023-04", not(feature = "no-default-tag")))] +pub use package_2023_04::*; +#[cfg(feature = "package-2022-10")] +pub mod package_2022_10; +#[cfg(all(feature = "package-2022-10", not(feature = "no-default-tag")))] +pub use package_2022_10::*; +#[cfg(feature = "package-2022-05-01")] +pub mod package_2022_05_01; +#[cfg(all(feature = "package-2022-05-01", not(feature = "no-default-tag")))] +pub use package_2022_05_01::*; +#[cfg(feature = "package-2021-07-01")] +pub mod package_2021_07_01; +#[cfg(all(feature = "package-2021-07-01", not(feature = "no-default-tag")))] +pub use package_2021_07_01::*; +#[cfg(feature = "package-2021-04-01")] +pub mod package_2021_04_01; +#[cfg(all(feature = "package-2021-04-01", not(feature = "no-default-tag")))] +pub use package_2021_04_01::*; diff --git a/services/mgmt/machinelearningservices/src/package_2021_04_01/mod.rs b/services/mgmt/machinelearningservices/src/package_2021_04_01/mod.rs new file mode 100644 index 0000000000..35aa1a391c --- /dev/null +++ b/services/mgmt/machinelearningservices/src/package_2021_04_01/mod.rs @@ -0,0 +1,5862 @@ +#![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, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + 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) -> 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) -> 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) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> 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 { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + 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 machine_learning_compute_client(&self) -> machine_learning_compute::Client { + machine_learning_compute::Client(self.clone()) + } + pub fn machine_learning_service_client(&self) -> machine_learning_service::Client { + machine_learning_service::Client(self.clone()) + } + pub fn notebooks_client(&self) -> notebooks::Client { + notebooks::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { + private_endpoint_connections::Client(self.clone()) + } + pub fn private_link_resources_client(&self) -> private_link_resources::Client { + private_link_resources::Client(self.clone()) + } + pub fn quotas_client(&self) -> quotas::Client { + quotas::Client(self.clone()) + } + pub fn storage_account_client(&self) -> storage_account::Client { + storage_account::Client(self.clone()) + } + pub fn usages_client(&self) -> usages::Client { + usages::Client(self.clone()) + } + pub fn virtual_machine_sizes_client(&self) -> virtual_machine_sizes::Client { + virtual_machine_sizes::Client(self.clone()) + } + pub fn workspace_client(&self) -> workspace::Client { + workspace::Client(self.clone()) + } + pub fn workspace_connections_client(&self) -> workspace_connections::Client { + workspace_connections::Client(self.clone()) + } + pub fn workspace_features_client(&self) -> workspace_features::Client { + workspace_features::Client(self.clone()) + } + pub fn workspaces_client(&self) -> workspaces::Client { + workspaces::Client(self.clone()) + } +} +pub mod operations { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available Azure Machine Learning Workspaces REST API operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = ""] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.MachineLearningServices/operations", + self.client.endpoint(), + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod workspaces { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the properties of the specified machine learning workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Creates or updates a workspace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `parameters`: The parameters for creating or updating a machine learning workspace."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates a machine learning workspace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `parameters`: The parameters for updating a machine learning workspace."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a machine learning workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Lists all the available machine learning workspaces under the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> 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(), + skip: None, + } + } + #[doc = "Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn resync_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> resync_keys::RequestBuilder { + resync_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Lists all the available machine learning workspaces under the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + skip: None, + } + } + #[doc = "return notebook access token and refresh token"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_notebook_access_token( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_notebook_access_token::RequestBuilder { + list_notebook_access_token::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) parameters: models::Workspace, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) parameters: models::WorkspaceUpdateParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod list_by_resource_group { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListWorkspaceKeysResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod resync_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/resyncKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod list_by_subscription { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/workspaces", + self.client.endpoint(), + &self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod list_notebook_access_token { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NotebookAccessTokenResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookAccessToken" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_features { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all enabled features for a workspace"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListAmlUserFeatureResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/features", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod usages { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the current usage information as well as limits for AML resources for given subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `location`: The location for which resource usage is queried."] + pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListUsagesResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/usages", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod virtual_machine_sizes { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns supported VM Sizes in a location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `location`: The location upon which virtual-machine-sizes is queried."] + #[doc = "* `subscription_id`: Azure subscription identifier."] + pub fn list(&self, location: impl Into, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + location: location.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VirtualMachineSizeListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) location: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/vmSizes", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod quotas { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Update quota for each VM family in workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `location`: The location for update quota is queried."] + #[doc = "* `parameters`: Quota update parameters."] + #[doc = "* `subscription_id`: Azure subscription identifier."] + pub fn update( + &self, + location: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + location: location.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the currently assigned Workspace Quotas based on VMFamily."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `location`: The location for which resource usage is queried."] + pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + } + pub mod update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UpdateWorkspaceQuotasResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) location: String, + pub(crate) parameters: models::QuotaUpdateParameters, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/updateQuotas", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListWorkspaceQuotas = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/quotas", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod machine_learning_compute { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets computes in specified workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_by_workspace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_by_workspace::RequestBuilder { + list_by_workspace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + } + } + #[doc = "Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + #[doc = "* `parameters`: Payload with Machine Learning compute definition."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + #[doc = "* `parameters`: Additional parameters for cluster update."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes specified Machine Learning compute."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + #[doc = "* `underlying_resource_action`: Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + underlying_resource_action: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + underlying_resource_action: underlying_resource_action.into(), + } + } + #[doc = "Get the details (e.g IP address, port etc) of all the compute nodes in the compute."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn list_nodes( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> list_nodes::RequestBuilder { + list_nodes::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Gets secrets related to Machine Learning compute (storage keys, service credentials, etc)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Posts a start action to a compute instance"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn start( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> start::RequestBuilder { + start::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Posts a stop action to a compute instance"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn stop( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> stop::RequestBuilder { + stop::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Posts a restart action to a compute instance"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn restart( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> restart::RequestBuilder { + restart::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + } + pub mod list_by_workspace { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PaginatedComputeResourcesList = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeResource = 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 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + pub(crate) parameters: models::ComputeResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + pub(crate) parameters: models::ClusterUpdateParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + pub(crate) underlying_resource_action: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let underlying_resource_action = &this.underlying_resource_action; + req.url_mut() + .query_pairs_mut() + .append_pair("underlyingResourceAction", underlying_resource_action); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod list_nodes { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AmlComputeNodesInformation = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + 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()), + ); + 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, "2021-04-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::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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listNodes", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeSecretsUnion = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod start { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/start", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod stop { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/stop", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod restart { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/restart", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod workspace { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all skus with associated features"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + pub fn list_skus(&self, subscription_id: impl Into) -> list_skus::RequestBuilder { + list_skus::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_skus { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SkuListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/workspaces/skus", + self.client.endpoint(), + &self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod private_endpoint_connections { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the specified private endpoint connection associated with the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + #[doc = "Update the state of specified private endpoint connection associated with the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] + #[doc = "* `properties`: The private endpoint connection properties."] + pub fn put( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + private_endpoint_connection_name: impl Into, + properties: impl Into, + ) -> put::RequestBuilder { + put::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + properties: properties.into(), + } + } + #[doc = "Deletes the specified private endpoint connection associated with the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod put { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) properties: models::PrivateEndpointConnection, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod private_link_resources { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the private link resources that need to be created for a workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_by_workspace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_by_workspace::RequestBuilder { + list_by_workspace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod list_by_workspace { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResourceListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateLinkResources", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod machine_learning_service { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets services in specified workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_by_workspace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_by_workspace::RequestBuilder { + list_by_workspace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + model_id: None, + model_name: None, + tag: None, + tags: None, + properties: None, + run_id: None, + expand: None, + orderby: None, + } + } + #[doc = "Get a Service by name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `service_name`: Name of the Azure Machine Learning service."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + service_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + service_name: service_name.into(), + expand: None, + } + } + #[doc = "Creates or updates service. This call will update a service if it exists. This is a nonrecoverable operation. If your intent is to create a new service, do a GET first to verify that it does not exist yet."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `service_name`: Name of the Azure Machine Learning service."] + #[doc = "* `properties`: The payload that is used to create or update the Service."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + service_name: impl Into, + properties: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + service_name: service_name.into(), + properties: properties.into(), + } + } + #[doc = "Delete a specific Service.."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `service_name`: Name of the Azure Machine Learning service."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + service_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + service_name: service_name.into(), + } + } + } + pub mod list_by_workspace { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PaginatedServiceList = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) skip: Option, + pub(crate) model_id: Option, + pub(crate) model_name: Option, + pub(crate) tag: Option, + pub(crate) tags: Option, + pub(crate) properties: Option, + pub(crate) run_id: Option, + pub(crate) expand: Option, + pub(crate) orderby: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "The Model Id."] + pub fn model_id(mut self, model_id: impl Into) -> Self { + self.model_id = Some(model_id.into()); + self + } + #[doc = "The Model name."] + pub fn model_name(mut self, model_name: impl Into) -> Self { + self.model_name = Some(model_name.into()); + self + } + #[doc = "The object tag."] + pub fn tag(mut self, tag: impl Into) -> Self { + self.tag = Some(tag.into()); + self + } + #[doc = "A set of tags with which to filter the returned services. It is a comma separated string of tags key or tags key=value Example: tagKey1,tagKey2,tagKey3=value3 ."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "A set of properties with which to filter the returned services. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] + pub fn properties(mut self, properties: impl Into) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "runId for model associated with service."] + pub fn run_id(mut self, run_id: impl Into) -> Self { + self.run_id = Some(run_id.into()); + self + } + #[doc = "Set to True to include Model details."] + pub fn expand(mut self, expand: bool) -> Self { + self.expand = Some(expand); + self + } + #[doc = "The option to order the response."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-04-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(model_id) = &this.model_id { + req.url_mut().query_pairs_mut().append_pair("modelId", model_id); + } + if let Some(model_name) = &this.model_name { + req.url_mut().query_pairs_mut().append_pair("modelName", model_name); + } + if let Some(tag) = &this.tag { + req.url_mut().query_pairs_mut().append_pair("tag", tag); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(properties) = &this.properties { + req.url_mut().query_pairs_mut().append_pair("properties", properties); + } + if let Some(run_id) = &this.run_id { + req.url_mut().query_pairs_mut().append_pair("runId", run_id); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("expand", &expand.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("orderby", orderby); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/services", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) service_name: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "Set to True to include Model details."] + pub fn expand(mut self, expand: bool) -> Self { + self.expand = Some(expand); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("expand", &expand.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/services/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.service_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceResource = 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 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) service_name: String, + pub(crate) properties: models::CreateServiceRequestUnion, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/services/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.service_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) service_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/services/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.service_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} +pub mod notebooks { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn prepare( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> prepare::RequestBuilder { + prepare::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod prepare { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NotebookResourceInfo = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/prepareNotebook", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{ + get_retry_after, + location::{get_location, get_provisioning_state, FinalState}, + LroStatus, + }, + sleep::sleep, + }; + use std::time::Duration; + let this = self.clone(); + let response = this.send().await?; + let headers = response.as_raw_response().headers(); + let location = get_location(headers, FinalState::Location)?; + if let Some(url) = location { + loop { + let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); + let credential = self.client.token_credential(); + let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let response = self.client.send(&mut req).await?; + let headers = response.headers(); + let retry_after = get_retry_after(headers); + let bytes = response.into_body().collect().await?; + let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { + Error::message( + ErrorKind::Other, + "Long running operation failed (missing provisioning state)".to_string(), + ) + })?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => { + let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); + let credential = self.client.token_credential(); + let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let response = self.client.send(&mut req).await?; + return Response(response).into_body().await; + } + LroStatus::Failed => { + return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) + } + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + } else { + response.into_body().await + } + }) + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListNotebookKeysResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod storage_account { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListStorageAccountKeysResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listStorageAccountKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_connections { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all connections under a AML workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + target: None, + category: None, + } + } + #[doc = "Get the detail of a workspace connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `connection_name`: Friendly name of the workspace connection"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + connection_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + connection_name: connection_name.into(), + } + } + #[doc = "Add a new workspace connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `connection_name`: Friendly name of the workspace connection"] + #[doc = "* `parameters`: The object for creating or updating a new workspace connection"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + connection_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + connection_name: connection_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Delete a workspace connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription identifier."] + #[doc = "* `resource_group_name`: Name of the resource group in which workspace is located."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `connection_name`: Friendly name of the workspace connection"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + connection_name: connection_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PaginatedWorkspaceConnectionsList = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) target: Option, + pub(crate) category: Option, + } + impl RequestBuilder { + #[doc = "Target of the workspace connection."] + pub fn target(mut self, target: impl Into) -> Self { + self.target = Some(target.into()); + self + } + #[doc = "Category of the workspace connection."] + pub fn category(mut self, category: impl Into) -> Self { + self.category = Some(category.into()); + self + } + #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = ""] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + if let Some(target) = &this.target { + req.url_mut().query_pairs_mut().append_pair("target", target); + } + if let Some(category) = &this.category { + req.url_mut().query_pairs_mut().append_pair("category", category); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.connection_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) connection_name: String, + pub(crate) parameters: models::WorkspaceConnectionDto, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.connection_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.connection_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-04-01"); + } + Ok(url) + } + } + } +} diff --git a/services/mgmt/machinelearningservices/src/package_2021_04_01/models.rs b/services/mgmt/machinelearningservices/src/package_2021_04_01/models.rs new file mode 100644 index 0000000000..24caeaceb1 --- /dev/null +++ b/services/mgmt/machinelearningservices/src/package_2021_04_01/models.rs @@ -0,0 +1,5296 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AciServiceCreateRequest { + #[serde(flatten)] + pub create_service_request: CreateServiceRequest, + #[doc = "The resource requirements for the container (cpu and memory)."] + #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] + pub container_resource_requirements: Option, + #[doc = "Whether or not authentication is enabled on the service."] + #[serde(rename = "authEnabled", default, skip_serializing_if = "Option::is_none")] + pub auth_enabled: Option, + #[doc = "Whether or not SSL is enabled."] + #[serde(rename = "sslEnabled", default, skip_serializing_if = "Option::is_none")] + pub ssl_enabled: Option, + #[doc = "Whether or not Application Insights is enabled."] + #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] + pub app_insights_enabled: Option, + #[doc = "Details of the data collection options specified."] + #[serde(rename = "dataCollection", default, skip_serializing_if = "Option::is_none")] + pub data_collection: Option, + #[doc = "The public SSL certificate in PEM format to use if SSL is enabled."] + #[serde(rename = "sslCertificate", default, skip_serializing_if = "Option::is_none")] + pub ssl_certificate: Option, + #[doc = "The public SSL key in PEM format for the certificate."] + #[serde(rename = "sslKey", default, skip_serializing_if = "Option::is_none")] + pub ssl_key: Option, + #[doc = "The CName for the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cname: Option, + #[doc = "The Dns label for the service."] + #[serde(rename = "dnsNameLabel", default, skip_serializing_if = "Option::is_none")] + pub dns_name_label: Option, + #[doc = "The virtual network configuration."] + #[serde(rename = "vnetConfiguration", default, skip_serializing_if = "Option::is_none")] + pub vnet_configuration: Option, + #[doc = "The encryption properties."] + #[serde(rename = "encryptionProperties", default, skip_serializing_if = "Option::is_none")] + pub encryption_properties: Option, +} +impl AciServiceCreateRequest { + pub fn new(create_service_request: CreateServiceRequest) -> Self { + Self { + create_service_request, + container_resource_requirements: None, + auth_enabled: None, + ssl_enabled: None, + app_insights_enabled: None, + data_collection: None, + ssl_certificate: None, + ssl_key: None, + cname: None, + dns_name_label: None, + vnet_configuration: None, + encryption_properties: None, + } + } +} +#[doc = "The response for an ACI service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AciServiceResponse { + #[serde(flatten)] + pub service_response_base: ServiceResponseBase, + #[doc = "The resource requirements for the container (cpu and memory)."] + #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] + pub container_resource_requirements: Option, + #[doc = "The Uri for sending scoring requests."] + #[serde(rename = "scoringUri", default, skip_serializing_if = "Option::is_none")] + pub scoring_uri: Option, + #[doc = "The name of the Azure location/region."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Whether or not authentication is enabled on the service."] + #[serde(rename = "authEnabled", default, skip_serializing_if = "Option::is_none")] + pub auth_enabled: Option, + #[doc = "Whether or not SSL is enabled."] + #[serde(rename = "sslEnabled", default, skip_serializing_if = "Option::is_none")] + pub ssl_enabled: Option, + #[doc = "Whether or not Application Insights is enabled."] + #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] + pub app_insights_enabled: Option, + #[doc = "Details of the data collection options specified."] + #[serde(rename = "dataCollection", default, skip_serializing_if = "Option::is_none")] + pub data_collection: Option, + #[doc = "The public SSL certificate in PEM format to use if SSL is enabled."] + #[serde(rename = "sslCertificate", default, skip_serializing_if = "Option::is_none")] + pub ssl_certificate: Option, + #[doc = "The public SSL key in PEM format for the certificate."] + #[serde(rename = "sslKey", default, skip_serializing_if = "Option::is_none")] + pub ssl_key: Option, + #[doc = "The CName for the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cname: Option, + #[doc = "The public IP address for the service."] + #[serde(rename = "publicIp", default, skip_serializing_if = "Option::is_none")] + pub public_ip: Option, + #[doc = "The public Fqdn for the service."] + #[serde(rename = "publicFqdn", default, skip_serializing_if = "Option::is_none")] + pub public_fqdn: Option, + #[doc = "The Uri for sending swagger requests."] + #[serde(rename = "swaggerUri", default, skip_serializing_if = "Option::is_none")] + pub swagger_uri: Option, + #[doc = "Details on the models and configurations."] + #[serde(rename = "modelConfigMap", default, skip_serializing_if = "Option::is_none")] + pub model_config_map: Option, + #[doc = "The list of models."] + #[serde( + rename = "models", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub models_: Vec, + #[doc = "The Environment, models and assets used for inferencing."] + #[serde(rename = "environmentImageRequest", default, skip_serializing_if = "Option::is_none")] + pub environment_image_request: Option, + #[doc = "The virtual network configuration."] + #[serde(rename = "vnetConfiguration", default, skip_serializing_if = "Option::is_none")] + pub vnet_configuration: Option, + #[doc = "The encryption properties."] + #[serde(rename = "encryptionProperties", default, skip_serializing_if = "Option::is_none")] + pub encryption_properties: Option, +} +impl AciServiceResponse { + pub fn new(service_response_base: ServiceResponseBase) -> Self { + Self { + service_response_base, + container_resource_requirements: None, + scoring_uri: None, + location: None, + auth_enabled: None, + ssl_enabled: None, + app_insights_enabled: None, + data_collection: None, + ssl_certificate: None, + ssl_key: None, + cname: None, + public_ip: None, + public_fqdn: None, + swagger_uri: None, + model_config_map: None, + models_: Vec::new(), + environment_image_request: None, + vnet_configuration: None, + encryption_properties: None, + } + } +} +#[doc = "A Machine Learning compute based on AKS."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Aks { + #[serde(flatten)] + pub compute: Compute, + #[doc = "AKS properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Aks { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod aks { + use super::*; + #[doc = "AKS properties"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Cluster full qualified domain name"] + #[serde(rename = "clusterFqdn", default, skip_serializing_if = "Option::is_none")] + pub cluster_fqdn: Option, + #[doc = "System services"] + #[serde( + rename = "systemServices", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub system_services: Vec, + #[doc = "Number of agents"] + #[serde(rename = "agentCount", default, skip_serializing_if = "Option::is_none")] + pub agent_count: Option, + #[doc = "Agent virtual machine size"] + #[serde(rename = "agentVmSize", default, skip_serializing_if = "Option::is_none")] + pub agent_vm_size: Option, + #[doc = "Intended usage of the cluster"] + #[serde(rename = "clusterPurpose", default, skip_serializing_if = "Option::is_none")] + pub cluster_purpose: Option, + #[doc = "The ssl configuration for scoring"] + #[serde(rename = "sslConfiguration", default, skip_serializing_if = "Option::is_none")] + pub ssl_configuration: Option, + #[doc = "Advance configuration for AKS networking"] + #[serde(rename = "aksNetworkingConfiguration", default, skip_serializing_if = "Option::is_none")] + pub aks_networking_configuration: Option, + #[doc = "Load Balancer Type"] + #[serde(rename = "loadBalancerType", default, skip_serializing_if = "Option::is_none")] + pub load_balancer_type: Option, + #[doc = "Load Balancer Subnet"] + #[serde(rename = "loadBalancerSubnet", default, skip_serializing_if = "Option::is_none")] + pub load_balancer_subnet: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } + pub mod properties { + use super::*; + #[doc = "Intended usage of the cluster"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ClusterPurpose")] + pub enum ClusterPurpose { + FastProd, + DenseProd, + DevTest, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ClusterPurpose { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ClusterPurpose { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ClusterPurpose { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::FastProd => serializer.serialize_unit_variant("ClusterPurpose", 0u32, "FastProd"), + Self::DenseProd => serializer.serialize_unit_variant("ClusterPurpose", 1u32, "DenseProd"), + Self::DevTest => serializer.serialize_unit_variant("ClusterPurpose", 2u32, "DevTest"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ClusterPurpose { + fn default() -> Self { + Self::FastProd + } + } + #[doc = "Load Balancer Type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LoadBalancerType")] + pub enum LoadBalancerType { + PublicIp, + InternalLoadBalancer, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LoadBalancerType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LoadBalancerType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LoadBalancerType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::PublicIp => serializer.serialize_unit_variant("LoadBalancerType", 0u32, "PublicIp"), + Self::InternalLoadBalancer => serializer.serialize_unit_variant("LoadBalancerType", 1u32, "InternalLoadBalancer"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for LoadBalancerType { + fn default() -> Self { + Self::PublicIp + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AksReplicaStatus { + #[doc = "The desired number of replicas."] + #[serde(rename = "desiredReplicas", default, skip_serializing_if = "Option::is_none")] + pub desired_replicas: Option, + #[doc = "The number of updated replicas."] + #[serde(rename = "updatedReplicas", default, skip_serializing_if = "Option::is_none")] + pub updated_replicas: Option, + #[doc = "The number of available replicas."] + #[serde(rename = "availableReplicas", default, skip_serializing_if = "Option::is_none")] + pub available_replicas: Option, + #[doc = "The error details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl AksReplicaStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The request to create an AKS service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AksServiceCreateRequest { + #[serde(flatten)] + pub create_endpoint_variant_request: CreateEndpointVariantRequest, + #[doc = "The number of replicas on the cluster."] + #[serde(rename = "numReplicas", default, skip_serializing_if = "Option::is_none")] + pub num_replicas: Option, + #[doc = "Details of the data collection options specified."] + #[serde(rename = "dataCollection", default, skip_serializing_if = "Option::is_none")] + pub data_collection: Option, + #[doc = "The name of the compute resource."] + #[serde(rename = "computeName", default, skip_serializing_if = "Option::is_none")] + pub compute_name: Option, + #[doc = "Whether or not Application Insights is enabled."] + #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] + pub app_insights_enabled: Option, + #[doc = "The auto scaler properties."] + #[serde(rename = "autoScaler", default, skip_serializing_if = "Option::is_none")] + pub auto_scaler: Option, + #[doc = "The resource requirements for the container (cpu and memory)."] + #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] + pub container_resource_requirements: Option, + #[doc = "The maximum number of concurrent requests per container."] + #[serde(rename = "maxConcurrentRequestsPerContainer", default, skip_serializing_if = "Option::is_none")] + pub max_concurrent_requests_per_container: Option, + #[doc = "Maximum time a request will wait in the queue (in milliseconds). After this time, the service will return 503 (Service Unavailable)"] + #[serde(rename = "maxQueueWaitMs", default, skip_serializing_if = "Option::is_none")] + pub max_queue_wait_ms: Option, + #[doc = "Kubernetes namespace for the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option, + #[doc = "The scoring timeout in milliseconds."] + #[serde(rename = "scoringTimeoutMs", default, skip_serializing_if = "Option::is_none")] + pub scoring_timeout_ms: Option, + #[doc = "Whether or not authentication is enabled."] + #[serde(rename = "authEnabled", default, skip_serializing_if = "Option::is_none")] + pub auth_enabled: Option, + #[doc = "The liveness probe requirements."] + #[serde(rename = "livenessProbeRequirements", default, skip_serializing_if = "Option::is_none")] + pub liveness_probe_requirements: Option, + #[doc = "Whether or not AAD authentication is enabled."] + #[serde(rename = "aadAuthEnabled", default, skip_serializing_if = "Option::is_none")] + pub aad_auth_enabled: Option, +} +impl AksServiceCreateRequest { + pub fn new(create_endpoint_variant_request: CreateEndpointVariantRequest) -> Self { + Self { + create_endpoint_variant_request, + num_replicas: None, + data_collection: None, + compute_name: None, + app_insights_enabled: None, + auto_scaler: None, + container_resource_requirements: None, + max_concurrent_requests_per_container: None, + max_queue_wait_ms: None, + namespace: None, + scoring_timeout_ms: None, + auth_enabled: None, + liveness_probe_requirements: None, + aad_auth_enabled: None, + } + } +} +#[doc = "The response for an AKS service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AksServiceResponse { + #[serde(flatten)] + pub aks_variant_response: AksVariantResponse, + #[doc = "The list of models."] + #[serde( + rename = "models", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub models_: Vec, + #[doc = "The resource requirements for the container (cpu and memory)."] + #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] + pub container_resource_requirements: Option, + #[doc = "The maximum number of concurrent requests per container."] + #[serde(rename = "maxConcurrentRequestsPerContainer", default, skip_serializing_if = "Option::is_none")] + pub max_concurrent_requests_per_container: Option, + #[doc = "Maximum time a request will wait in the queue (in milliseconds). After this time, the service will return 503 (Service Unavailable)"] + #[serde(rename = "maxQueueWaitMs", default, skip_serializing_if = "Option::is_none")] + pub max_queue_wait_ms: Option, + #[doc = "The name of the compute resource."] + #[serde(rename = "computeName", default, skip_serializing_if = "Option::is_none")] + pub compute_name: Option, + #[doc = "The Kubernetes namespace of the deployment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option, + #[doc = "The number of replicas on the cluster."] + #[serde(rename = "numReplicas", default, skip_serializing_if = "Option::is_none")] + pub num_replicas: Option, + #[doc = "Details of the data collection options specified."] + #[serde(rename = "dataCollection", default, skip_serializing_if = "Option::is_none")] + pub data_collection: Option, + #[doc = "Whether or not Application Insights is enabled."] + #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] + pub app_insights_enabled: Option, + #[doc = "The auto scaler properties."] + #[serde(rename = "autoScaler", default, skip_serializing_if = "Option::is_none")] + pub auto_scaler: Option, + #[doc = "The Uri for sending scoring requests."] + #[serde(rename = "scoringUri", default, skip_serializing_if = "Option::is_none")] + pub scoring_uri: Option, + #[doc = "The deployment status."] + #[serde(rename = "deploymentStatus", default, skip_serializing_if = "Option::is_none")] + pub deployment_status: Option, + #[doc = "The scoring timeout in milliseconds."] + #[serde(rename = "scoringTimeoutMs", default, skip_serializing_if = "Option::is_none")] + pub scoring_timeout_ms: Option, + #[doc = "The liveness probe requirements."] + #[serde(rename = "livenessProbeRequirements", default, skip_serializing_if = "Option::is_none")] + pub liveness_probe_requirements: Option, + #[doc = "Whether or not authentication is enabled."] + #[serde(rename = "authEnabled", default, skip_serializing_if = "Option::is_none")] + pub auth_enabled: Option, + #[doc = "Whether or not AAD authentication is enabled."] + #[serde(rename = "aadAuthEnabled", default, skip_serializing_if = "Option::is_none")] + pub aad_auth_enabled: Option, + #[doc = "The Uri for sending swagger requests."] + #[serde(rename = "swaggerUri", default, skip_serializing_if = "Option::is_none")] + pub swagger_uri: Option, + #[doc = "Details on the models and configurations."] + #[serde(rename = "modelConfigMap", default, skip_serializing_if = "Option::is_none")] + pub model_config_map: Option, + #[doc = "The Environment, models and assets used for inferencing."] + #[serde(rename = "environmentImageRequest", default, skip_serializing_if = "Option::is_none")] + pub environment_image_request: Option, +} +impl AksServiceResponse { + pub fn new(aks_variant_response: AksVariantResponse) -> Self { + Self { + aks_variant_response, + models_: Vec::new(), + container_resource_requirements: None, + max_concurrent_requests_per_container: None, + max_queue_wait_ms: None, + compute_name: None, + namespace: None, + num_replicas: None, + data_collection: None, + app_insights_enabled: None, + auto_scaler: None, + scoring_uri: None, + deployment_status: None, + scoring_timeout_ms: None, + liveness_probe_requirements: None, + auth_enabled: None, + aad_auth_enabled: None, + swagger_uri: None, + model_config_map: None, + environment_image_request: None, + } + } +} +#[doc = "The response for an AKS variant."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AksVariantResponse { + #[serde(flatten)] + pub service_response_base: ServiceResponseBase, + #[doc = "Is this the default variant."] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option, + #[doc = "The amount of traffic variant receives."] + #[serde(rename = "trafficPercentile", default, skip_serializing_if = "Option::is_none")] + pub traffic_percentile: Option, + #[doc = "The type of the variant."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl AksVariantResponse { + pub fn new(service_response_base: ServiceResponseBase) -> Self { + Self { + service_response_base, + is_default: None, + traffic_percentile: None, + type_: None, + } + } +} +pub mod aks_variant_response { + use super::*; + #[doc = "The type of the variant."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Control, + Treatment, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Control => serializer.serialize_unit_variant("Type", 0u32, "Control"), + Self::Treatment => serializer.serialize_unit_variant("Type", 1u32, "Treatment"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Secrets related to a Machine Learning compute based on AKS."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AksComputeSecrets { + #[serde(flatten)] + pub compute_secrets: ComputeSecrets, + #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] + #[serde(rename = "userKubeConfig", default, skip_serializing_if = "Option::is_none")] + pub user_kube_config: Option, + #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] + #[serde(rename = "adminKubeConfig", default, skip_serializing_if = "Option::is_none")] + pub admin_kube_config: Option, + #[doc = "Image registry pull secret."] + #[serde(rename = "imagePullSecretName", default, skip_serializing_if = "Option::is_none")] + pub image_pull_secret_name: Option, +} +impl AksComputeSecrets { + pub fn new(compute_secrets: ComputeSecrets) -> Self { + Self { + compute_secrets, + user_kube_config: None, + admin_kube_config: None, + image_pull_secret_name: None, + } + } +} +#[doc = "Advance configuration for AKS networking"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AksNetworkingConfiguration { + #[doc = "Virtual network subnet resource ID the compute nodes belong to"] + #[serde(rename = "subnetId", default, skip_serializing_if = "Option::is_none")] + pub subnet_id: Option, + #[doc = "A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges."] + #[serde(rename = "serviceCidr", default, skip_serializing_if = "Option::is_none")] + pub service_cidr: Option, + #[doc = "An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr."] + #[serde(rename = "dnsServiceIP", default, skip_serializing_if = "Option::is_none")] + pub dns_service_ip: Option, + #[doc = "A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range."] + #[serde(rename = "dockerBridgeCidr", default, skip_serializing_if = "Option::is_none")] + pub docker_bridge_cidr: Option, +} +impl AksNetworkingConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An Azure Machine Learning compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmlCompute { + #[serde(flatten)] + pub compute: Compute, + #[doc = "AML Compute properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AmlCompute { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod aml_compute { + use super::*; + #[doc = "AML Compute properties"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Compute OS Type"] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "Virtual Machine Size"] + #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] + pub vm_size: Option, + #[doc = "Virtual Machine priority"] + #[serde(rename = "vmPriority", default, skip_serializing_if = "Option::is_none")] + pub vm_priority: Option, + #[doc = "Virtual Machine image for Windows AML Compute"] + #[serde(rename = "virtualMachineImage", default, skip_serializing_if = "Option::is_none")] + pub virtual_machine_image: Option, + #[doc = "Network is isolated or not"] + #[serde(rename = "isolatedNetwork", default, skip_serializing_if = "Option::is_none")] + pub isolated_network: Option, + #[doc = "scale settings for AML Compute"] + #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] + pub scale_settings: Option, + #[doc = "Settings for user account that gets created on each on the nodes of a compute."] + #[serde(rename = "userAccountCredentials", default, skip_serializing_if = "Option::is_none")] + pub user_account_credentials: Option, + #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subnet: Option, + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] + #[serde(rename = "remoteLoginPortPublicAccess", default, skip_serializing_if = "Option::is_none")] + pub remote_login_port_public_access: Option, + #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] + #[serde(rename = "allocationState", default, skip_serializing_if = "Option::is_none")] + pub allocation_state: Option, + #[doc = "The time at which the compute entered its current allocation state."] + #[serde(rename = "allocationStateTransitionTime", default, with = "azure_core::date::rfc3339::option")] + pub allocation_state_transition_time: Option, + #[doc = "Collection of errors encountered by various compute nodes during node setup."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, + #[doc = "The number of compute nodes currently assigned to the compute."] + #[serde(rename = "currentNodeCount", default, skip_serializing_if = "Option::is_none")] + pub current_node_count: Option, + #[doc = "The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation."] + #[serde(rename = "targetNodeCount", default, skip_serializing_if = "Option::is_none")] + pub target_node_count: Option, + #[doc = "Counts of various compute node states on the amlCompute."] + #[serde(rename = "nodeStateCounts", default, skip_serializing_if = "Option::is_none")] + pub node_state_counts: Option, + #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] + #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] + pub enable_node_public_ip: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } + pub mod properties { + use super::*; + #[doc = "Compute OS Type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OsType")] + pub enum OsType { + Linux, + Windows, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OsType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OsType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OsType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), + Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for OsType { + fn default() -> Self { + Self::Linux + } + } + #[doc = "Virtual Machine priority"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "VmPriority")] + pub enum VmPriority { + Dedicated, + LowPriority, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for VmPriority { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for VmPriority { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for VmPriority { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Dedicated => serializer.serialize_unit_variant("VmPriority", 0u32, "Dedicated"), + Self::LowPriority => serializer.serialize_unit_variant("VmPriority", 1u32, "LowPriority"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "RemoteLoginPortPublicAccess")] + pub enum RemoteLoginPortPublicAccess { + Enabled, + Disabled, + NotSpecified, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for RemoteLoginPortPublicAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for RemoteLoginPortPublicAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for RemoteLoginPortPublicAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 1u32, "Disabled"), + Self::NotSpecified => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 2u32, "NotSpecified"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for RemoteLoginPortPublicAccess { + fn default() -> Self { + Self::NotSpecified + } + } + #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AllocationState")] + pub enum AllocationState { + Steady, + Resizing, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AllocationState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AllocationState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AllocationState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Steady => serializer.serialize_unit_variant("AllocationState", 0u32, "Steady"), + Self::Resizing => serializer.serialize_unit_variant("AllocationState", 1u32, "Resizing"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "Compute node information related to a AmlCompute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AmlComputeNodeInformation { + #[doc = "ID of the compute node."] + #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")] + pub node_id: Option, + #[doc = "Private IP address of the compute node."] + #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, + #[doc = "Public IP address of the compute node."] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, + #[doc = "SSH port number of the node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] + #[serde(rename = "nodeState", default, skip_serializing_if = "Option::is_none")] + pub node_state: Option, + #[doc = "ID of the Experiment running on the node, if any else null."] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option, +} +impl AmlComputeNodeInformation { + pub fn new() -> Self { + Self::default() + } +} +pub mod aml_compute_node_information { + use super::*; + #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "NodeState")] + pub enum NodeState { + #[serde(rename = "idle")] + Idle, + #[serde(rename = "running")] + Running, + #[serde(rename = "preparing")] + Preparing, + #[serde(rename = "unusable")] + Unusable, + #[serde(rename = "leaving")] + Leaving, + #[serde(rename = "preempted")] + Preempted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for NodeState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for NodeState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for NodeState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Idle => serializer.serialize_unit_variant("NodeState", 0u32, "idle"), + Self::Running => serializer.serialize_unit_variant("NodeState", 1u32, "running"), + Self::Preparing => serializer.serialize_unit_variant("NodeState", 2u32, "preparing"), + Self::Unusable => serializer.serialize_unit_variant("NodeState", 3u32, "unusable"), + Self::Leaving => serializer.serialize_unit_variant("NodeState", 4u32, "leaving"), + Self::Preempted => serializer.serialize_unit_variant("NodeState", 5u32, "preempted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Compute node information related to a AmlCompute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmlComputeNodesInformation { + #[serde(flatten)] + pub compute_nodes_information: ComputeNodesInformation, + #[doc = "The collection of returned AmlCompute nodes details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub nodes: Vec, + #[doc = "The continuation token."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AmlComputeNodesInformation { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl AmlComputeNodesInformation { + pub fn new(compute_nodes_information: ComputeNodesInformation) -> Self { + Self { + compute_nodes_information, + nodes: Vec::new(), + next_link: None, + } + } +} +#[doc = "Features enabled for a workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AmlUserFeature { + #[doc = "Specifies the feature ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Specifies the feature name "] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Describes the feature for user experience"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl AmlUserFeature { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A user that can be assigned to a compute instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssignedUser { + #[doc = "User’s AAD Object Id."] + #[serde(rename = "objectId")] + pub object_id: String, + #[doc = "User’s AAD Tenant Id."] + #[serde(rename = "tenantId")] + pub tenant_id: String, +} +impl AssignedUser { + pub fn new(object_id: String, tenant_id: String) -> Self { + Self { object_id, tenant_id } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthKeys { + #[doc = "The primary key."] + #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] + pub primary_key: Option, + #[doc = "The secondary key."] + #[serde(rename = "secondaryKey", default, skip_serializing_if = "Option::is_none")] + pub secondary_key: Option, +} +impl AuthKeys { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Auto pause properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoPauseProperties { + #[serde(rename = "delayInMinutes", default, skip_serializing_if = "Option::is_none")] + pub delay_in_minutes: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl AutoPauseProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Auto scale properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoScaleProperties { + #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] + pub min_node_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "maxNodeCount", default, skip_serializing_if = "Option::is_none")] + pub max_node_count: Option, +} +impl AutoScaleProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Auto Scaler properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoScaler { + #[doc = "Option to enable/disable auto scaling."] + #[serde(rename = "autoscaleEnabled", default, skip_serializing_if = "Option::is_none")] + pub autoscale_enabled: Option, + #[doc = "The minimum number of replicas to scale down to."] + #[serde(rename = "minReplicas", default, skip_serializing_if = "Option::is_none")] + pub min_replicas: Option, + #[doc = "The maximum number of replicas in the cluster."] + #[serde(rename = "maxReplicas", default, skip_serializing_if = "Option::is_none")] + pub max_replicas: Option, + #[doc = "The target utilization percentage to use for determining whether to scale the cluster."] + #[serde(rename = "targetUtilization", default, skip_serializing_if = "Option::is_none")] + pub target_utilization: Option, + #[doc = "The amount of seconds to wait between auto scale updates."] + #[serde(rename = "refreshPeriodInSeconds", default, skip_serializing_if = "Option::is_none")] + pub refresh_period_in_seconds: Option, +} +impl AutoScaler { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AmlCompute update parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterUpdateParameters { + #[doc = "The properties of a amlCompute that need to be updated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ClusterUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a amlCompute that need to be updated."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterUpdateProperties { + #[doc = "scale settings for AML Compute"] + #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] + pub scale_settings: Option, +} +impl ClusterUpdateProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Machine Learning compute object."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Compute { + #[doc = "The type of compute"] + #[serde(rename = "computeType")] + pub compute_type: ComputeType, + #[doc = "Location for the underlying compute"] + #[serde(rename = "computeLocation", default, skip_serializing_if = "Option::is_none")] + pub compute_location: Option, + #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The description of the Machine Learning compute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The time at which the compute was created."] + #[serde(rename = "createdOn", default, with = "azure_core::date::rfc3339::option")] + pub created_on: Option, + #[doc = "The time at which the compute was last modified."] + #[serde(rename = "modifiedOn", default, with = "azure_core::date::rfc3339::option")] + pub modified_on: Option, + #[doc = "ARM resource id of the underlying compute"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Errors during provisioning"] + #[serde( + rename = "provisioningErrors", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub provisioning_errors: Vec, + #[doc = "Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false."] + #[serde(rename = "isAttachedCompute", default, skip_serializing_if = "Option::is_none")] + pub is_attached_compute: Option, + #[doc = "Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, +} +impl Compute { + pub fn new(compute_type: ComputeType) -> Self { + Self { + compute_type, + compute_location: None, + provisioning_state: None, + description: None, + created_on: None, + modified_on: None, + resource_id: None, + provisioning_errors: Vec::new(), + is_attached_compute: None, + disable_local_auth: None, + } + } +} +pub mod compute { + use super::*; + #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Unknown, + Updating, + Creating, + Deleting, + Succeeded, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ComputeUnion { + #[serde(rename = "AKS")] + Aks(Aks), + AmlCompute(AmlCompute), + ComputeInstance(ComputeInstance), + DataFactory(DataFactory), + DataLakeAnalytics(DataLakeAnalytics), + Databricks(Databricks), + #[serde(rename = "HDInsight")] + HdInsight(HdInsight), + SynapseSpark(SynapseSpark), + VirtualMachine(VirtualMachine), +} +#[doc = "An Azure Machine Learning compute instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ComputeInstance { + #[serde(flatten)] + pub compute: Compute, + #[doc = "Compute Instance properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ComputeInstance { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod compute_instance { + use super::*; + #[doc = "Compute Instance properties"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Virtual Machine Size"] + #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] + pub vm_size: Option, + #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subnet: Option, + #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] + #[serde(rename = "applicationSharingPolicy", default, skip_serializing_if = "Option::is_none")] + pub application_sharing_policy: Option, + #[doc = "Specifies policy and settings for SSH access."] + #[serde(rename = "sshSettings", default, skip_serializing_if = "Option::is_none")] + pub ssh_settings: Option, + #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] + #[serde(rename = "connectivityEndpoints", default, skip_serializing_if = "Option::is_none")] + pub connectivity_endpoints: Option, + #[doc = "Describes available applications and their endpoints on this ComputeInstance."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub applications: Vec, + #[doc = "Describes information on user who created this ComputeInstance."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "Collection of errors encountered on this ComputeInstance."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, + #[doc = "Current state of an ComputeInstance."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] + #[serde(rename = "computeInstanceAuthorizationType", default, skip_serializing_if = "Option::is_none")] + pub compute_instance_authorization_type: Option, + #[doc = "Settings for a personal compute instance."] + #[serde(rename = "personalComputeInstanceSettings", default, skip_serializing_if = "Option::is_none")] + pub personal_compute_instance_settings: Option, + #[doc = "Details of customized scripts to execute for setting up the cluster."] + #[serde(rename = "setupScripts", default, skip_serializing_if = "Option::is_none")] + pub setup_scripts: Option, + #[doc = "The last operation on ComputeInstance."] + #[serde(rename = "lastOperation", default, skip_serializing_if = "Option::is_none")] + pub last_operation: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } + pub mod properties { + use super::*; + #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ApplicationSharingPolicy")] + pub enum ApplicationSharingPolicy { + Personal, + Shared, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ApplicationSharingPolicy { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ApplicationSharingPolicy { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ApplicationSharingPolicy { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Personal => serializer.serialize_unit_variant("ApplicationSharingPolicy", 0u32, "Personal"), + Self::Shared => serializer.serialize_unit_variant("ApplicationSharingPolicy", 1u32, "Shared"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ApplicationSharingPolicy { + fn default() -> Self { + Self::Shared + } + } + #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ComputeInstanceAuthorizationType")] + pub enum ComputeInstanceAuthorizationType { + #[serde(rename = "personal")] + Personal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ComputeInstanceAuthorizationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ComputeInstanceAuthorizationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ComputeInstanceAuthorizationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Personal => serializer.serialize_unit_variant("ComputeInstanceAuthorizationType", 0u32, "personal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ComputeInstanceAuthorizationType { + fn default() -> Self { + Self::Personal + } + } + } +} +#[doc = "Defines an Aml Instance application and its connectivity endpoint URI."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceApplication { + #[doc = "Name of the ComputeInstance application."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Application' endpoint URI."] + #[serde(rename = "endpointUri", default, skip_serializing_if = "Option::is_none")] + pub endpoint_uri: Option, +} +impl ComputeInstanceApplication { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceConnectivityEndpoints { + #[doc = "Public IP Address of this ComputeInstance."] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, + #[doc = "Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed)."] + #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, +} +impl ComputeInstanceConnectivityEndpoints { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes information on user who created this ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceCreatedBy { + #[doc = "Name of the user."] + #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] + pub user_name: Option, + #[doc = "Uniquely identifies user' Azure Active Directory organization."] + #[serde(rename = "userOrgId", default, skip_serializing_if = "Option::is_none")] + pub user_org_id: Option, + #[doc = "Uniquely identifies the user within his/her organization."] + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option, +} +impl ComputeInstanceCreatedBy { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The last operation on ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceLastOperation { + #[doc = "Name of the last operation."] + #[serde(rename = "operationName", default, skip_serializing_if = "Option::is_none")] + pub operation_name: Option, + #[doc = "Time of the last operation."] + #[serde(rename = "operationTime", default, with = "azure_core::date::rfc3339::option")] + pub operation_time: Option, + #[doc = "Operation status."] + #[serde(rename = "operationStatus", default, skip_serializing_if = "Option::is_none")] + pub operation_status: Option, +} +impl ComputeInstanceLastOperation { + pub fn new() -> Self { + Self::default() + } +} +pub mod compute_instance_last_operation { + use super::*; + #[doc = "Name of the last operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OperationName")] + pub enum OperationName { + Create, + Start, + Stop, + Restart, + Reimage, + Delete, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OperationName { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OperationName { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OperationName { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Create => serializer.serialize_unit_variant("OperationName", 0u32, "Create"), + Self::Start => serializer.serialize_unit_variant("OperationName", 1u32, "Start"), + Self::Stop => serializer.serialize_unit_variant("OperationName", 2u32, "Stop"), + Self::Restart => serializer.serialize_unit_variant("OperationName", 3u32, "Restart"), + Self::Reimage => serializer.serialize_unit_variant("OperationName", 4u32, "Reimage"), + Self::Delete => serializer.serialize_unit_variant("OperationName", 5u32, "Delete"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Operation status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OperationStatus")] + pub enum OperationStatus { + InProgress, + Succeeded, + CreateFailed, + StartFailed, + StopFailed, + RestartFailed, + ReimageFailed, + DeleteFailed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OperationStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OperationStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OperationStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("OperationStatus", 0u32, "InProgress"), + Self::Succeeded => serializer.serialize_unit_variant("OperationStatus", 1u32, "Succeeded"), + Self::CreateFailed => serializer.serialize_unit_variant("OperationStatus", 2u32, "CreateFailed"), + Self::StartFailed => serializer.serialize_unit_variant("OperationStatus", 3u32, "StartFailed"), + Self::StopFailed => serializer.serialize_unit_variant("OperationStatus", 4u32, "StopFailed"), + Self::RestartFailed => serializer.serialize_unit_variant("OperationStatus", 5u32, "RestartFailed"), + Self::ReimageFailed => serializer.serialize_unit_variant("OperationStatus", 6u32, "ReimageFailed"), + Self::DeleteFailed => serializer.serialize_unit_variant("OperationStatus", 7u32, "DeleteFailed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Specifies policy and settings for SSH access."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceSshSettings { + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] + #[serde(rename = "sshPublicAccess", default, skip_serializing_if = "Option::is_none")] + pub ssh_public_access: Option, + #[doc = "Describes the admin user name."] + #[serde(rename = "adminUserName", default, skip_serializing_if = "Option::is_none")] + pub admin_user_name: Option, + #[doc = "Describes the port for connecting through SSH."] + #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] + pub ssh_port: Option, + #[doc = "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs."] + #[serde(rename = "adminPublicKey", default, skip_serializing_if = "Option::is_none")] + pub admin_public_key: Option, +} +impl ComputeInstanceSshSettings { + pub fn new() -> Self { + Self::default() + } +} +pub mod compute_instance_ssh_settings { + use super::*; + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SshPublicAccess")] + pub enum SshPublicAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SshPublicAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SshPublicAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SshPublicAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("SshPublicAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("SshPublicAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for SshPublicAccess { + fn default() -> Self { + Self::Disabled + } + } +} +#[doc = "Current state of an ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ComputeInstanceState")] +pub enum ComputeInstanceState { + Creating, + CreateFailed, + Deleting, + Running, + Restarting, + JobRunning, + SettingUp, + SetupFailed, + Starting, + Stopped, + Stopping, + UserSettingUp, + UserSetupFailed, + Unknown, + Unusable, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ComputeInstanceState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ComputeInstanceState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ComputeInstanceState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ComputeInstanceState", 0u32, "Creating"), + Self::CreateFailed => serializer.serialize_unit_variant("ComputeInstanceState", 1u32, "CreateFailed"), + Self::Deleting => serializer.serialize_unit_variant("ComputeInstanceState", 2u32, "Deleting"), + Self::Running => serializer.serialize_unit_variant("ComputeInstanceState", 3u32, "Running"), + Self::Restarting => serializer.serialize_unit_variant("ComputeInstanceState", 4u32, "Restarting"), + Self::JobRunning => serializer.serialize_unit_variant("ComputeInstanceState", 5u32, "JobRunning"), + Self::SettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 6u32, "SettingUp"), + Self::SetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 7u32, "SetupFailed"), + Self::Starting => serializer.serialize_unit_variant("ComputeInstanceState", 8u32, "Starting"), + Self::Stopped => serializer.serialize_unit_variant("ComputeInstanceState", 9u32, "Stopped"), + Self::Stopping => serializer.serialize_unit_variant("ComputeInstanceState", 10u32, "Stopping"), + Self::UserSettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 11u32, "UserSettingUp"), + Self::UserSetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 12u32, "UserSetupFailed"), + Self::Unknown => serializer.serialize_unit_variant("ComputeInstanceState", 13u32, "Unknown"), + Self::Unusable => serializer.serialize_unit_variant("ComputeInstanceState", 14u32, "Unusable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Compute nodes information related to a Machine Learning compute. Might differ for every type of compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ComputeNodesInformation { + #[doc = "The type of compute"] + #[serde(rename = "computeType")] + pub compute_type: ComputeType, + #[doc = "The continuation token."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl ComputeNodesInformation { + pub fn new(compute_type: ComputeType) -> Self { + Self { + compute_type, + next_link: None, + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ComputeNodesInformationUnion { + AmlCompute(AmlComputeNodesInformation), +} +#[doc = "Machine Learning compute object wrapped into ARM resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Machine Learning compute object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ComputeResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Secrets related to a Machine Learning compute. Might differ for every type of compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ComputeSecrets { + #[doc = "The type of compute"] + #[serde(rename = "computeType")] + pub compute_type: ComputeType, +} +impl ComputeSecrets { + pub fn new(compute_type: ComputeType) -> Self { + Self { compute_type } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ComputeSecretsUnion { + #[serde(rename = "AKS")] + Aks(AksComputeSecrets), + Databricks(DatabricksComputeSecrets), + VirtualMachine(VirtualMachineSecrets), +} +#[doc = "The type of compute"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ComputeType")] +pub enum ComputeType { + #[serde(rename = "AKS")] + Aks, + AmlCompute, + ComputeInstance, + DataFactory, + VirtualMachine, + #[serde(rename = "HDInsight")] + HdInsight, + Databricks, + DataLakeAnalytics, + SynapseSpark, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ComputeType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ComputeType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ComputeType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aks => serializer.serialize_unit_variant("ComputeType", 0u32, "AKS"), + Self::AmlCompute => serializer.serialize_unit_variant("ComputeType", 1u32, "AmlCompute"), + Self::ComputeInstance => serializer.serialize_unit_variant("ComputeType", 2u32, "ComputeInstance"), + Self::DataFactory => serializer.serialize_unit_variant("ComputeType", 3u32, "DataFactory"), + Self::VirtualMachine => serializer.serialize_unit_variant("ComputeType", 4u32, "VirtualMachine"), + Self::HdInsight => serializer.serialize_unit_variant("ComputeType", 5u32, "HDInsight"), + Self::Databricks => serializer.serialize_unit_variant("ComputeType", 6u32, "Databricks"), + Self::DataLakeAnalytics => serializer.serialize_unit_variant("ComputeType", 7u32, "DataLakeAnalytics"), + Self::SynapseSpark => serializer.serialize_unit_variant("ComputeType", 8u32, "SynapseSpark"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ContainerRegistry { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, +} +impl ContainerRegistry { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ContainerRegistryResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, +} +impl ContainerRegistryResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource requirements for the container (cpu and memory)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ContainerResourceRequirements { + #[doc = "The minimum amount of CPU cores to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cpu: Option, + #[doc = "The maximum amount of CPU cores allowed to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(rename = "cpuLimit", default, skip_serializing_if = "Option::is_none")] + pub cpu_limit: Option, + #[doc = "The minimum amount of memory (in GB) to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(rename = "memoryInGB", default, skip_serializing_if = "Option::is_none")] + pub memory_in_gb: Option, + #[doc = "The maximum amount of memory (in GB) allowed to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(rename = "memoryInGBLimit", default, skip_serializing_if = "Option::is_none")] + pub memory_in_gb_limit: Option, + #[doc = "The number of GPU cores in the container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gpu: Option, + #[doc = "The number of FPGA PCIE devices exposed to the container. Must be multiple of 2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fpga: Option, +} +impl ContainerResourceRequirements { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CosmosDbSettings { + #[doc = "The throughput of the collections in cosmosdb database"] + #[serde(rename = "collectionsThroughput", default, skip_serializing_if = "Option::is_none")] + pub collections_throughput: Option, +} +impl CosmosDbSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Variant properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateEndpointVariantRequest { + #[serde(flatten)] + pub create_service_request: CreateServiceRequest, + #[doc = "Is this the default variant."] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option, + #[doc = "The amount of traffic variant receives."] + #[serde(rename = "trafficPercentile", default, skip_serializing_if = "Option::is_none")] + pub traffic_percentile: Option, + #[doc = "The type of the variant."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl CreateEndpointVariantRequest { + pub fn new(create_service_request: CreateServiceRequest) -> Self { + Self { + create_service_request, + is_default: None, + traffic_percentile: None, + type_: None, + } + } +} +pub mod create_endpoint_variant_request { + use super::*; + #[doc = "The type of the variant."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Control, + Treatment, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Control => serializer.serialize_unit_variant("Type", 0u32, "Control"), + Self::Treatment => serializer.serialize_unit_variant("Type", 1u32, "Treatment"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The base class for creating a service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateServiceRequest { + #[doc = "The description of the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The service tag dictionary. Tags are mutable."] + #[serde(rename = "kvTags", default, skip_serializing_if = "Option::is_none")] + pub kv_tags: Option, + #[doc = "The service properties dictionary. Properties are immutable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "The authentication keys."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub keys: Option, + #[doc = "The compute environment type for the service."] + #[serde(rename = "computeType")] + pub compute_type: create_service_request::ComputeType, + #[doc = "The Environment, models and assets needed for inferencing."] + #[serde(rename = "environmentImageRequest", default, skip_serializing_if = "Option::is_none")] + pub environment_image_request: Option, + #[doc = "The name of the Azure location/region."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl CreateServiceRequest { + pub fn new(compute_type: create_service_request::ComputeType) -> Self { + Self { + description: None, + kv_tags: None, + properties: None, + keys: None, + compute_type, + environment_image_request: None, + location: None, + } + } +} +pub mod create_service_request { + use super::*; + #[doc = "The compute environment type for the service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ComputeType")] + pub enum ComputeType { + #[serde(rename = "ACI")] + Aci, + #[serde(rename = "AKS")] + Aks, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ComputeType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ComputeType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ComputeType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aci => serializer.serialize_unit_variant("ComputeType", 0u32, "ACI"), + Self::Aks => serializer.serialize_unit_variant("ComputeType", 1u32, "AKS"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum CreateServiceRequestUnion { + #[serde(rename = "ACI")] + Aci(AciServiceCreateRequest), + Custom(CreateEndpointVariantRequest), +} +#[doc = "A DataFactory compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataFactory { + #[serde(flatten)] + pub compute: Compute, +} +impl DataFactory { + pub fn new(compute: Compute) -> Self { + Self { compute } + } +} +#[doc = "A DataLakeAnalytics compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataLakeAnalytics { + #[serde(flatten)] + pub compute: Compute, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DataLakeAnalytics { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod data_lake_analytics { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "DataLake Store Account Name"] + #[serde(rename = "dataLakeStoreAccountName", default, skip_serializing_if = "Option::is_none")] + pub data_lake_store_account_name: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "A DataFactory compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Databricks { + #[serde(flatten)] + pub compute: Compute, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Databricks { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod databricks { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Databricks access token"] + #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] + pub databricks_access_token: Option, + #[doc = "Workspace Url"] + #[serde(rename = "workspaceUrl", default, skip_serializing_if = "Option::is_none")] + pub workspace_url: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Secrets related to a Machine Learning compute based on Databricks."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DatabricksComputeSecrets { + #[serde(flatten)] + pub compute_secrets: ComputeSecrets, + #[doc = "access token for databricks account."] + #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] + pub databricks_access_token: Option, +} +impl DatabricksComputeSecrets { + pub fn new(compute_secrets: ComputeSecrets) -> Self { + Self { + compute_secrets, + databricks_access_token: None, + } + } +} +#[doc = "The dataset reference object."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DatasetReference { + #[doc = "The name of the dataset reference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The id of the dataset reference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl DatasetReference { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EncryptionProperties { + #[doc = "vault base Url"] + #[serde(rename = "vaultBaseUrl")] + pub vault_base_url: String, + #[doc = "Encryption Key name"] + #[serde(rename = "keyName")] + pub key_name: String, + #[doc = "Encryption Key Version"] + #[serde(rename = "keyVersion")] + pub key_version: String, +} +impl EncryptionProperties { + pub fn new(vault_base_url: String, key_name: String, key_version: String) -> Self { + Self { + vault_base_url, + key_name, + key_version, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EncryptionProperty { + #[doc = "Indicates whether or not the encryption is enabled for the workspace."] + pub status: encryption_property::Status, + #[doc = "Identity that will be used to access key vault for encryption at rest"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[serde(rename = "keyVaultProperties")] + pub key_vault_properties: KeyVaultProperties, +} +impl EncryptionProperty { + pub fn new(status: encryption_property::Status, key_vault_properties: KeyVaultProperties) -> Self { + Self { + status, + identity: None, + key_vault_properties, + } + } +} +pub mod encryption_property { + use super::*; + #[doc = "Indicates whether or not the encryption is enabled for the workspace."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Status", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("Status", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Request to create a Docker image based on Environment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EnvironmentImageRequest { + #[doc = "The name of the driver file."] + #[serde(rename = "driverProgram", default, skip_serializing_if = "Option::is_none")] + pub driver_program: Option, + #[doc = "The list of assets."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub assets: Vec, + #[doc = "The list of model Ids."] + #[serde( + rename = "modelIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub model_ids: Vec, + #[doc = "The list of models."] + #[serde( + rename = "models", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub models_: Vec, + #[doc = "The details of the AZURE ML environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option, + #[doc = "The unique identifying details of the AZURE ML environment."] + #[serde(rename = "environmentReference", default, skip_serializing_if = "Option::is_none")] + pub environment_reference: Option, +} +impl EnvironmentImageRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Request to create a Docker image based on Environment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EnvironmentImageResponse { + #[doc = "The name of the driver file."] + #[serde(rename = "driverProgram", default, skip_serializing_if = "Option::is_none")] + pub driver_program: Option, + #[doc = "The list of assets."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub assets: Vec, + #[doc = "The list of model Ids."] + #[serde( + rename = "modelIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub model_ids: Vec, + #[doc = "The list of models."] + #[serde( + rename = "models", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub models_: Vec, + #[doc = "The details of the AZURE ML environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option, + #[doc = "The unique identifying details of the AZURE ML environment."] + #[serde(rename = "environmentReference", default, skip_serializing_if = "Option::is_none")] + pub environment_reference: Option, +} +impl EnvironmentImageResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EnvironmentReference { + #[doc = "Name of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Version of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl EnvironmentReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Error detail information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorDetail { + #[doc = "Error code."] + pub code: String, + #[doc = "Error message."] + pub message: String, +} +impl ErrorDetail { + pub fn new(code: String, message: String) -> Self { + Self { code, message } + } +} +#[doc = "Error response information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "Error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The target of the particular error"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "An array of error detail objects."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The estimated price info for using a VM of a particular OS type, tier, etc."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EstimatedVmPrice { + #[doc = "The price charged for using the VM."] + #[serde(rename = "retailPrice")] + pub retail_price: f64, + #[doc = "Operating system type used by the VM."] + #[serde(rename = "osType")] + pub os_type: estimated_vm_price::OsType, + #[doc = "The type of the VM."] + #[serde(rename = "vmTier")] + pub vm_tier: estimated_vm_price::VmTier, +} +impl EstimatedVmPrice { + pub fn new(retail_price: f64, os_type: estimated_vm_price::OsType, vm_tier: estimated_vm_price::VmTier) -> Self { + Self { + retail_price, + os_type, + vm_tier, + } + } +} +pub mod estimated_vm_price { + use super::*; + #[doc = "Operating system type used by the VM."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OsType")] + pub enum OsType { + Linux, + Windows, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OsType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OsType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OsType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), + Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of the VM."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "VmTier")] + pub enum VmTier { + Standard, + LowPriority, + Spot, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for VmTier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for VmTier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for VmTier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Standard => serializer.serialize_unit_variant("VmTier", 0u32, "Standard"), + Self::LowPriority => serializer.serialize_unit_variant("VmTier", 1u32, "LowPriority"), + Self::Spot => serializer.serialize_unit_variant("VmTier", 2u32, "Spot"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The estimated price info for using a VM."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EstimatedVmPrices { + #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] + #[serde(rename = "billingCurrency")] + pub billing_currency: estimated_vm_prices::BillingCurrency, + #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] + #[serde(rename = "unitOfMeasure")] + pub unit_of_measure: estimated_vm_prices::UnitOfMeasure, + #[doc = "The list of estimated prices for using a VM of a particular OS type, tier, etc."] + pub values: Vec, +} +impl EstimatedVmPrices { + pub fn new( + billing_currency: estimated_vm_prices::BillingCurrency, + unit_of_measure: estimated_vm_prices::UnitOfMeasure, + values: Vec, + ) -> Self { + Self { + billing_currency, + unit_of_measure, + values, + } + } +} +pub mod estimated_vm_prices { + use super::*; + #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "BillingCurrency")] + pub enum BillingCurrency { + #[serde(rename = "USD")] + Usd, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for BillingCurrency { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for BillingCurrency { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for BillingCurrency { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Usd => serializer.serialize_unit_variant("BillingCurrency", 0u32, "USD"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "UnitOfMeasure")] + pub enum UnitOfMeasure { + OneHour, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for UnitOfMeasure { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for UnitOfMeasure { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for UnitOfMeasure { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::OneHour => serializer.serialize_unit_variant("UnitOfMeasure", 0u32, "OneHour"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A HDInsight compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HdInsight { + #[serde(flatten)] + pub compute: Compute, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl HdInsight { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod hd_insight { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Port open for ssh connections on the master node of the cluster."] + #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] + pub ssh_port: Option, + #[doc = "Public IP address of the master node of the cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[doc = "Admin credentials for virtual machine"] + #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] + pub administrator_account: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Identity for the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Identity { + #[doc = "The principal ID of resource identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of resource."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The identity type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "dictionary containing all the user assigned identities, with resourceId of the UAI as key."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl Identity { + pub fn new() -> Self { + Self::default() + } +} +pub mod identity { + use super::*; + #[doc = "The identity type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + SystemAssigned, + #[serde(rename = "SystemAssigned,UserAssigned")] + SystemAssignedUserAssigned, + UserAssigned, + None, + } +} +#[doc = "Identity that will be used to access key vault for encryption at rest"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IdentityForCmk { + #[doc = "The ArmId of the user assigned identity that will be used to access the customer managed key vault"] + #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identity: Option, +} +impl IdentityForCmk { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The type of identity that creates/modifies resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "IdentityType")] +pub enum IdentityType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for IdentityType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for IdentityType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for IdentityType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("IdentityType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("IdentityType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("IdentityType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("IdentityType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "An Image asset."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ImageAsset { + #[doc = "The Asset Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The mime type."] + #[serde(rename = "mimeType", default, skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + #[doc = "The Url of the Asset."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, + #[doc = "Whether the Asset is unpacked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unpack: Option, +} +impl ImageAsset { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct KeyVaultProperties { + #[doc = "The ArmId of the keyVault where the customer owned encryption key is present."] + #[serde(rename = "keyVaultArmId")] + pub key_vault_arm_id: String, + #[doc = "Key vault uri to access the encryption key."] + #[serde(rename = "keyIdentifier")] + pub key_identifier: String, + #[doc = "For future use - The client id of the identity which will be used to access key vault."] + #[serde(rename = "identityClientId", default, skip_serializing_if = "Option::is_none")] + pub identity_client_id: Option, +} +impl KeyVaultProperties { + pub fn new(key_vault_arm_id: String, key_identifier: String) -> Self { + Self { + key_vault_arm_id, + key_identifier, + identity_client_id: None, + } + } +} +#[doc = "The List Aml user feature operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListAmlUserFeatureResult { + #[doc = "The list of AML user facing features."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ListAmlUserFeatureResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ListAmlUserFeatureResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListNotebookKeysResult { + #[serde(rename = "primaryAccessKey", default, skip_serializing_if = "Option::is_none")] + pub primary_access_key: Option, + #[serde(rename = "secondaryAccessKey", default, skip_serializing_if = "Option::is_none")] + pub secondary_access_key: Option, +} +impl ListNotebookKeysResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListStorageAccountKeysResult { + #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] + pub user_storage_key: Option, +} +impl ListStorageAccountKeysResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List Usages operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListUsagesResult { + #[doc = "The list of AML resource usages."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ListUsagesResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ListUsagesResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListWorkspaceKeysResult { + #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] + pub user_storage_key: Option, + #[serde(rename = "userStorageResourceId", default, skip_serializing_if = "Option::is_none")] + pub user_storage_resource_id: Option, + #[serde(rename = "appInsightsInstrumentationKey", default, skip_serializing_if = "Option::is_none")] + pub app_insights_instrumentation_key: Option, + #[serde(rename = "containerRegistryCredentials", default, skip_serializing_if = "Option::is_none")] + pub container_registry_credentials: Option, + #[serde(rename = "notebookAccessKeys", default, skip_serializing_if = "Option::is_none")] + pub notebook_access_keys: Option, +} +impl ListWorkspaceKeysResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List WorkspaceQuotasByVMFamily operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListWorkspaceQuotas { + #[doc = "The list of Workspace Quotas by VM Family"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ListWorkspaceQuotas { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ListWorkspaceQuotas { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The liveness probe requirements."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LivenessProbeRequirements { + #[doc = "The number of failures to allow before returning an unhealthy status."] + #[serde(rename = "failureThreshold", default, skip_serializing_if = "Option::is_none")] + pub failure_threshold: Option, + #[doc = "The number of successful probes before returning a healthy status."] + #[serde(rename = "successThreshold", default, skip_serializing_if = "Option::is_none")] + pub success_threshold: Option, + #[doc = "The probe timeout in seconds."] + #[serde(rename = "timeoutSeconds", default, skip_serializing_if = "Option::is_none")] + pub timeout_seconds: Option, + #[doc = "The length of time between probes in seconds."] + #[serde(rename = "periodSeconds", default, skip_serializing_if = "Option::is_none")] + pub period_seconds: Option, + #[doc = "The delay before the first probe in seconds."] + #[serde(rename = "initialDelaySeconds", default, skip_serializing_if = "Option::is_none")] + pub initial_delay_seconds: Option, +} +impl LivenessProbeRequirements { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Wrapper for error response to follow ARM guidelines."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MachineLearningServiceError { + #[doc = "Error response information."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for MachineLearningServiceError { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl MachineLearningServiceError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An Azure Machine Learning Model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Model { + #[doc = "The Model Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The Model name."] + pub name: String, + #[doc = "The Model framework."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub framework: Option, + #[doc = "The Model framework version."] + #[serde(rename = "frameworkVersion", default, skip_serializing_if = "Option::is_none")] + pub framework_version: Option, + #[doc = "The Model version assigned by Model Management Service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "The list of datasets associated with the model."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub datasets: Vec, + #[doc = "The URL of the Model. Usually a SAS URL."] + pub url: String, + #[doc = "The MIME type of Model content. For more details about MIME type, please open https://www.iana.org/assignments/media-types/media-types.xhtml"] + #[serde(rename = "mimeType")] + pub mime_type: String, + #[doc = "The Model description text."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The Model creation time (UTC)."] + #[serde(rename = "createdTime", default, with = "azure_core::date::rfc3339::option")] + pub created_time: Option, + #[doc = "The Model last modified time (UTC)."] + #[serde(rename = "modifiedTime", default, with = "azure_core::date::rfc3339::option")] + pub modified_time: Option, + #[doc = "Indicates whether we need to unpack the Model during docker Image creation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unpack: Option, + #[doc = "The Parent Model Id."] + #[serde(rename = "parentModelId", default, skip_serializing_if = "Option::is_none")] + pub parent_model_id: Option, + #[doc = "The RunId that created this model."] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option, + #[doc = "The name of the experiment where this model was created."] + #[serde(rename = "experimentName", default, skip_serializing_if = "Option::is_none")] + pub experiment_name: Option, + #[doc = "The Model tag dictionary. Items are mutable."] + #[serde(rename = "kvTags", default, skip_serializing_if = "Option::is_none")] + pub kv_tags: Option, + #[doc = "The Model property dictionary. Properties are immutable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Models derived from this model"] + #[serde( + rename = "derivedModelIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub derived_model_ids: Vec, + #[doc = "Sample Input Data for the Model. A reference to a dataset in the workspace in the format aml://dataset/{datasetId}"] + #[serde(rename = "sampleInputData", default, skip_serializing_if = "Option::is_none")] + pub sample_input_data: Option, + #[doc = "Sample Output Data for the Model. A reference to a dataset in the workspace in the format aml://dataset/{datasetId}"] + #[serde(rename = "sampleOutputData", default, skip_serializing_if = "Option::is_none")] + pub sample_output_data: Option, + #[doc = "The resource requirements for the container (cpu and memory)."] + #[serde(rename = "resourceRequirements", default, skip_serializing_if = "Option::is_none")] + pub resource_requirements: Option, +} +impl Model { + pub fn new(name: String, url: String, mime_type: String) -> Self { + Self { + id: None, + name, + framework: None, + framework_version: None, + version: None, + datasets: Vec::new(), + url, + mime_type, + description: None, + created_time: None, + modified_time: None, + unpack: None, + parent_model_id: None, + run_id: None, + experiment_name: None, + kv_tags: None, + properties: None, + derived_model_ids: Vec::new(), + sample_input_data: None, + sample_output_data: None, + resource_requirements: None, + } + } +} +#[doc = "The Model data collection properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ModelDataCollection { + #[doc = "Option for enabling/disabling Event Hub."] + #[serde(rename = "eventHubEnabled", default, skip_serializing_if = "Option::is_none")] + pub event_hub_enabled: Option, + #[doc = "Option for enabling/disabling storage."] + #[serde(rename = "storageEnabled", default, skip_serializing_if = "Option::is_none")] + pub storage_enabled: Option, +} +impl ModelDataCollection { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ModelDockerSection { + #[doc = "Base image used for Docker-based runs. Mutually exclusive with BaseDockerfile."] + #[serde(rename = "baseImage", default, skip_serializing_if = "Option::is_none")] + pub base_image: Option, + #[doc = "Base Dockerfile used for Docker-based runs. Mutually exclusive with BaseImage."] + #[serde(rename = "baseDockerfile", default, skip_serializing_if = "Option::is_none")] + pub base_dockerfile: Option, + #[doc = "Image registry that contains the base image."] + #[serde(rename = "baseImageRegistry", default, skip_serializing_if = "Option::is_none")] + pub base_image_registry: Option, +} +impl ModelDockerSection { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ModelDockerSectionResponse { + #[doc = "Base image used for Docker-based runs. Mutually exclusive with BaseDockerfile."] + #[serde(rename = "baseImage", default, skip_serializing_if = "Option::is_none")] + pub base_image: Option, + #[doc = "Base Dockerfile used for Docker-based runs. Mutually exclusive with BaseImage."] + #[serde(rename = "baseDockerfile", default, skip_serializing_if = "Option::is_none")] + pub base_dockerfile: Option, + #[doc = "Image registry that contains the base image."] + #[serde(rename = "baseImageRegistry", default, skip_serializing_if = "Option::is_none")] + pub base_image_registry: Option, +} +impl ModelDockerSectionResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ModelEnvironmentDefinition { + #[doc = "The name of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The environment version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Settings for a Python environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub python: Option, + #[doc = "Definition of environment variables to be defined in the environment."] + #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] + pub environment_variables: Option, + #[doc = "The definition of a Docker container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub docker: Option, + #[doc = "The configuration for a Spark environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub spark: Option, + #[doc = "Settings for a R environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub r: Option, + #[doc = "The inferencing stack version added to the image. To avoid adding an inferencing stack, do not set this value. Valid values: \"latest\"."] + #[serde(rename = "inferencingStackVersion", default, skip_serializing_if = "Option::is_none")] + pub inferencing_stack_version: Option, +} +impl ModelEnvironmentDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ModelEnvironmentDefinitionResponse { + #[doc = "The name of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The environment version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Settings for a Python environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub python: Option, + #[doc = "Definition of environment variables to be defined in the environment."] + #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] + pub environment_variables: Option, + #[doc = "The definition of a Docker container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub docker: Option, + #[doc = "The configuration for a Spark environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub spark: Option, + #[doc = "Settings for a R environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub r: Option, + #[doc = "The inferencing stack version added to the image. To avoid adding an inferencing stack, do not set this value. Valid values: \"latest\"."] + #[serde(rename = "inferencingStackVersion", default, skip_serializing_if = "Option::is_none")] + pub inferencing_stack_version: Option, +} +impl ModelEnvironmentDefinitionResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ModelPythonSection { + #[doc = "The python interpreter path to use if an environment build is not required. The path specified gets used to call the user script."] + #[serde(rename = "interpreterPath", default, skip_serializing_if = "Option::is_none")] + pub interpreter_path: Option, + #[doc = "True means that AzureML reuses an existing python environment; False means that AzureML will create a python environment based on the Conda dependencies specification."] + #[serde(rename = "userManagedDependencies", default, skip_serializing_if = "Option::is_none")] + pub user_managed_dependencies: Option, + #[doc = "A JObject containing Conda dependencies."] + #[serde(rename = "condaDependencies", default, skip_serializing_if = "Option::is_none")] + pub conda_dependencies: Option, + #[serde(rename = "baseCondaEnvironment", default, skip_serializing_if = "Option::is_none")] + pub base_conda_environment: Option, +} +impl ModelPythonSection { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ModelSparkSection { + #[doc = "The list of spark repositories."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub repositories: Vec, + #[doc = "The Spark packages to use."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub packages: Vec, + #[doc = "Whether to precache the packages."] + #[serde(rename = "precachePackages", default, skip_serializing_if = "Option::is_none")] + pub precache_packages: Option, +} +impl ModelSparkSection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Counts of various compute node states on the amlCompute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NodeStateCounts { + #[doc = "Number of compute nodes in idle state."] + #[serde(rename = "idleNodeCount", default, skip_serializing_if = "Option::is_none")] + pub idle_node_count: Option, + #[doc = "Number of compute nodes which are running jobs."] + #[serde(rename = "runningNodeCount", default, skip_serializing_if = "Option::is_none")] + pub running_node_count: Option, + #[doc = "Number of compute nodes which are being prepared."] + #[serde(rename = "preparingNodeCount", default, skip_serializing_if = "Option::is_none")] + pub preparing_node_count: Option, + #[doc = "Number of compute nodes which are in unusable state."] + #[serde(rename = "unusableNodeCount", default, skip_serializing_if = "Option::is_none")] + pub unusable_node_count: Option, + #[doc = "Number of compute nodes which are leaving the amlCompute."] + #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] + pub leaving_node_count: Option, + #[doc = "Number of compute nodes which are in preempted state."] + #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] + pub preempted_node_count: Option, +} +impl NodeStateCounts { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NotebookAccessTokenResult { + #[serde(rename = "notebookResourceId", default, skip_serializing_if = "Option::is_none")] + pub notebook_resource_id: Option, + #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] + pub host_name: Option, + #[serde(rename = "publicDns", default, skip_serializing_if = "Option::is_none")] + pub public_dns: Option, + #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] + pub access_token: Option, + #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] + pub token_type: Option, + #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] + pub expires_in: Option, + #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option, +} +impl NotebookAccessTokenResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NotebookPreparationError { + #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "statusCode", default, skip_serializing_if = "Option::is_none")] + pub status_code: Option, +} +impl NotebookPreparationError { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NotebookResourceInfo { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fqdn: Option, + #[doc = "the data plane resourceId that used to initialize notebook component"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[serde(rename = "notebookPreparationError", default, skip_serializing_if = "Option::is_none")] + pub notebook_preparation_error: Option, +} +impl NotebookResourceInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Azure Machine Learning workspace REST API operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "Operation name: {provider}/{resource}/{operation}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Display name of operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Display name of operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The resource provider name: Microsoft.MachineLearningExperimentation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The resource on which the operation is performed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The operation that users can perform."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The description for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "An array of operations supported by the resource provider."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of AML workspace operations supported by the AML workspace resource provider."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paginated list of Machine Learning compute objects wrapped in ARM resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PaginatedComputeResourcesList { + #[doc = "An array of Machine Learning compute objects wrapped in ARM resource envelope."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A continuation link (absolute URI) to the next page of results in the list."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PaginatedComputeResourcesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl PaginatedComputeResourcesList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paginated list of Machine Learning service objects wrapped in ARM resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PaginatedServiceList { + #[doc = "An array of Machine Learning compute objects wrapped in ARM resource envelope."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A continuation link (absolute URI) to the next page of results in the list."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PaginatedServiceList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl PaginatedServiceList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paginated list of Workspace connection objects."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PaginatedWorkspaceConnectionsList { + #[doc = "An array of Workspace connection objects."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A continuation link (absolute URI) to the next page of results in the list."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PaginatedWorkspaceConnectionsList { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl PaginatedWorkspaceConnectionsList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Password { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl Password { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Settings for a personal compute instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PersonalComputeInstanceSettings { + #[doc = "A user that can be assigned to a compute instance."] + #[serde(rename = "assignedUser", default, skip_serializing_if = "Option::is_none")] + pub assigned_user: Option, +} +impl PersonalComputeInstanceSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Private Endpoint resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpoint { + #[doc = "The ARM identifier for Private Endpoint"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The ARM identifier for Subnet resource that private endpoint links to"] + #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] + pub subnet_arm_id: Option, +} +impl PrivateEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Private Endpoint Connection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnection { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the PrivateEndpointConnectProperties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PrivateEndpointConnection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the PrivateEndpointConnectProperties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnectionProperties { + #[doc = "The Private Endpoint resource."] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "A collection of information about the state of the connection between service consumer and provider."] + #[serde(rename = "privateLinkServiceConnectionState")] + pub private_link_service_connection_state: PrivateLinkServiceConnectionState, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PrivateEndpointConnectionProperties { + pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { + Self { + private_endpoint: None, + private_link_service_connection_state, + provisioning_state: None, + } + } +} +#[doc = "The current provisioning state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PrivateEndpointConnectionProvisioningState")] +pub enum PrivateEndpointConnectionProvisioningState { + Succeeded, + Creating, + Deleting, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PrivateEndpointConnectionProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PrivateEndpointConnectionProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), + Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"), + Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The private endpoint connection status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PrivateEndpointServiceConnectionStatus")] +pub enum PrivateEndpointServiceConnectionStatus { + Pending, + Approved, + Rejected, + Disconnected, + Timeout, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PrivateEndpointServiceConnectionStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PrivateEndpointServiceConnectionStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Pending"), + Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Approved"), + Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"), + Self::Disconnected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 3u32, "Disconnected"), + Self::Timeout => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 4u32, "Timeout"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A private link resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of a private link resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PrivateLinkResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of private link resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceListResult { + #[doc = "Array of private link resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl PrivateLinkResourceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a private link resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceProperties { + #[doc = "The private link resource group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "The private link resource required member names."] + #[serde( + rename = "requiredMembers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_members: Vec, + #[doc = "The private link resource Private link DNS zone name."] + #[serde( + rename = "requiredZoneNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_zone_names: Vec, +} +impl PrivateLinkResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A collection of information about the state of the connection between service consumer and provider."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkServiceConnectionState { + #[doc = "The private endpoint connection status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The reason for approval/rejection of the connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "A message indicating if changes on the service provider require any updates on the consumer."] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, +} +impl PrivateLinkServiceConnectionState { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties for Quota update or retrieval."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QuotaBaseProperties { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The maximum permitted quota of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "An enum describing the unit of quota measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, +} +impl QuotaBaseProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod quota_base_properties { + use super::*; + #[doc = "An enum describing the unit of quota measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Quota update parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QuotaUpdateParameters { + #[doc = "The list for update quota."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Region of workspace quota to be updated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl QuotaUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RCranPackage { + #[doc = "The package name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The repository name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option, +} +impl RCranPackage { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RGitHubPackage { + #[doc = "Repository address in the format username/repo[/subdir][@ref|#pull]."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option, + #[doc = "Personal access token to install from a private repo"] + #[serde(rename = "authToken", default, skip_serializing_if = "Option::is_none")] + pub auth_token: Option, +} +impl RGitHubPackage { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RGitHubPackageResponse { + #[doc = "Repository address in the format username/repo[/subdir][@ref|#pull]."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option, +} +impl RGitHubPackageResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RSection { + #[doc = "The version of R to be installed"] + #[serde(rename = "rVersion", default, skip_serializing_if = "Option::is_none")] + pub r_version: Option, + #[doc = "Indicates whether the environment is managed by user or by AzureML."] + #[serde(rename = "userManaged", default, skip_serializing_if = "Option::is_none")] + pub user_managed: Option, + #[doc = "The Rscript path to use if an environment build is not required.\r\nThe path specified gets used to call the user script."] + #[serde(rename = "rscriptPath", default, skip_serializing_if = "Option::is_none")] + pub rscript_path: Option, + #[doc = "Date of MRAN snapshot to use in YYYY-MM-DD format, e.g. \"2019-04-17\""] + #[serde(rename = "snapshotDate", default, skip_serializing_if = "Option::is_none")] + pub snapshot_date: Option, + #[doc = "The CRAN packages to use."] + #[serde( + rename = "cranPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cran_packages: Vec, + #[doc = "The packages directly from GitHub."] + #[serde( + rename = "gitHubPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub git_hub_packages: Vec, + #[doc = "The packages from custom urls."] + #[serde( + rename = "customUrlPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub custom_url_packages: Vec, + #[doc = "The packages from Bioconductor."] + #[serde( + rename = "bioConductorPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub bio_conductor_packages: Vec, +} +impl RSection { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RSectionResponse { + #[doc = "The version of R to be installed"] + #[serde(rename = "rVersion", default, skip_serializing_if = "Option::is_none")] + pub r_version: Option, + #[doc = "Indicates whether the environment is managed by user or by AzureML."] + #[serde(rename = "userManaged", default, skip_serializing_if = "Option::is_none")] + pub user_managed: Option, + #[doc = "The Rscript path to use if an environment build is not required.\r\nThe path specified gets used to call the user script."] + #[serde(rename = "rscriptPath", default, skip_serializing_if = "Option::is_none")] + pub rscript_path: Option, + #[doc = "Date of MRAN snapshot to use in YYYY-MM-DD format, e.g. \"2019-04-17\""] + #[serde(rename = "snapshotDate", default, skip_serializing_if = "Option::is_none")] + pub snapshot_date: Option, + #[doc = "The CRAN packages to use."] + #[serde( + rename = "cranPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cran_packages: Vec, + #[doc = "The packages directly from GitHub."] + #[serde( + rename = "gitHubPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub git_hub_packages: Vec, + #[doc = "The packages from custom urls."] + #[serde( + rename = "customUrlPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub custom_url_packages: Vec, + #[doc = "The packages from Bioconductor."] + #[serde( + rename = "bioConductorPackages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub bio_conductor_packages: Vec, +} +impl RSectionResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegistryListCredentialsResult { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub passwords: Vec, +} +impl RegistryListCredentialsResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Azure Resource Manager resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Specifies the name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Specifies the location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Specifies the type of the resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Contains resource tags defined as key/value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Sku of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Read only system data"] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceId { + #[doc = "The ID of the resource"] + pub id: String, +} +impl ResourceId { + pub fn new(id: String) -> Self { + Self { id } + } +} +#[doc = "The Resource Name."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceName { + #[doc = "The name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The localized name of the resource."] + #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] + pub localized_value: Option, +} +impl ResourceName { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The quota assigned to a resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceQuota { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Region of the AML workspace in the id."] + #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] + pub aml_workspace_location: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The Resource Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The maximum permitted quota of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "An enum describing the unit of quota measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, +} +impl ResourceQuota { + pub fn new() -> Self { + Self::default() + } +} +pub mod resource_quota { + use super::*; + #[doc = "An enum describing the unit of quota measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceSkuLocationInfo { + #[doc = "Location of the SKU"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "List of availability zones where the SKU is supported."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub zones: Vec, + #[doc = "Details of capabilities available to a SKU in specific zones."] + #[serde( + rename = "zoneDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub zone_details: Vec, +} +impl ResourceSkuLocationInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes The zonal capabilities of a SKU."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceSkuZoneDetails { + #[doc = "The set of zones that the SKU is available in with the specified capabilities."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub name: Vec, + #[doc = "A list of capabilities that are available for the SKU in the specified list of zones."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub capabilities: Vec, +} +impl ResourceSkuZoneDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The restriction because of which SKU cannot be used."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Restriction { + #[doc = "The type of restrictions. As of now only possible value for this is location."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, + #[doc = "The reason for the restriction."] + #[serde(rename = "reasonCode", default, skip_serializing_if = "Option::is_none")] + pub reason_code: Option, +} +impl Restriction { + pub fn new() -> Self { + Self::default() + } +} +pub mod restriction { + use super::*; + #[doc = "The reason for the restriction."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReasonCode")] + pub enum ReasonCode { + NotSpecified, + NotAvailableForRegion, + NotAvailableForSubscription, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReasonCode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReasonCode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReasonCode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NotSpecified => serializer.serialize_unit_variant("ReasonCode", 0u32, "NotSpecified"), + Self::NotAvailableForRegion => serializer.serialize_unit_variant("ReasonCode", 1u32, "NotAvailableForRegion"), + Self::NotAvailableForSubscription => serializer.serialize_unit_variant("ReasonCode", 2u32, "NotAvailableForSubscription"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Features/user capabilities associated with the sku"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SkuCapability { + #[doc = "Capability/Feature ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Details about the feature/capability"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl SkuCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "scale settings for AML Compute"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScaleSettings { + #[doc = "Max number of nodes to use"] + #[serde(rename = "maxNodeCount")] + pub max_node_count: i32, + #[doc = "Min number of nodes to use"] + #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] + pub min_node_count: Option, + #[doc = "Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format."] + #[serde(rename = "nodeIdleTimeBeforeScaleDown", default, skip_serializing_if = "Option::is_none")] + pub node_idle_time_before_scale_down: Option, +} +impl ScaleSettings { + pub fn new(max_node_count: i32) -> Self { + Self { + max_node_count, + min_node_count: None, + node_idle_time_before_scale_down: None, + } + } +} +#[doc = "Script reference"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptReference { + #[doc = "The storage source of the script: inline, workspace."] + #[serde(rename = "scriptSource", default, skip_serializing_if = "Option::is_none")] + pub script_source: Option, + #[doc = "The location of scripts in the mounted volume."] + #[serde(rename = "scriptData", default, skip_serializing_if = "Option::is_none")] + pub script_data: Option, + #[doc = "Optional command line arguments passed to the script to run."] + #[serde(rename = "scriptArguments", default, skip_serializing_if = "Option::is_none")] + pub script_arguments: Option, + #[doc = "Optional time period passed to timeout command."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, +} +impl ScriptReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Customized setup scripts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptsToExecute { + #[doc = "Script reference"] + #[serde(rename = "startupScript", default, skip_serializing_if = "Option::is_none")] + pub startup_script: Option, + #[doc = "Script reference"] + #[serde(rename = "creationScript", default, skip_serializing_if = "Option::is_none")] + pub creation_script: Option, +} +impl ScriptsToExecute { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceManagedResourcesSettings { + #[serde(rename = "cosmosDb", default, skip_serializing_if = "Option::is_none")] + pub cosmos_db: Option, +} +impl ServiceManagedResourcesSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Service principal credentials."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServicePrincipalCredentials { + #[doc = "Client Id"] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "Client secret"] + #[serde(rename = "clientSecret")] + pub client_secret: String, +} +impl ServicePrincipalCredentials { + pub fn new(client_id: String, client_secret: String) -> Self { + Self { client_id, client_secret } + } +} +#[doc = "Machine Learning service object wrapped into ARM resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The base service response. The correct inherited response based on computeType will be returned (ex. ACIServiceResponse)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ServiceResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The base service response. The correct inherited response based on computeType will be returned (ex. ACIServiceResponse)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceResponseBase { + #[doc = "The service description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The service tag dictionary. Tags are mutable."] + #[serde(rename = "kvTags", default, skip_serializing_if = "Option::is_none")] + pub kv_tags: Option, + #[doc = "The service property dictionary. Properties are immutable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "The current state of the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The error details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + #[doc = "The compute environment type for the service."] + #[serde(rename = "computeType")] + pub compute_type: service_response_base::ComputeType, + #[doc = "The deployment type for the service."] + #[serde(rename = "deploymentType", default, skip_serializing_if = "Option::is_none")] + pub deployment_type: Option, +} +impl ServiceResponseBase { + pub fn new(compute_type: service_response_base::ComputeType) -> Self { + Self { + description: None, + kv_tags: None, + properties: None, + state: None, + error: None, + compute_type, + deployment_type: None, + } + } +} +pub mod service_response_base { + use super::*; + #[doc = "The current state of the service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Transitioning, + Healthy, + Unhealthy, + Failed, + Unschedulable, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Transitioning => serializer.serialize_unit_variant("State", 0u32, "Transitioning"), + Self::Healthy => serializer.serialize_unit_variant("State", 1u32, "Healthy"), + Self::Unhealthy => serializer.serialize_unit_variant("State", 2u32, "Unhealthy"), + Self::Failed => serializer.serialize_unit_variant("State", 3u32, "Failed"), + Self::Unschedulable => serializer.serialize_unit_variant("State", 4u32, "Unschedulable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The compute environment type for the service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ComputeType")] + pub enum ComputeType { + #[serde(rename = "ACI")] + Aci, + #[serde(rename = "AKS")] + Aks, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ComputeType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ComputeType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ComputeType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aci => serializer.serialize_unit_variant("ComputeType", 0u32, "ACI"), + Self::Aks => serializer.serialize_unit_variant("ComputeType", 1u32, "AKS"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The deployment type for the service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DeploymentType")] + pub enum DeploymentType { + #[serde(rename = "GRPCRealtimeEndpoint")] + GrpcRealtimeEndpoint, + HttpRealtimeEndpoint, + Batch, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DeploymentType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DeploymentType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DeploymentType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::GrpcRealtimeEndpoint => serializer.serialize_unit_variant("DeploymentType", 0u32, "GRPCRealtimeEndpoint"), + Self::HttpRealtimeEndpoint => serializer.serialize_unit_variant("DeploymentType", 1u32, "HttpRealtimeEndpoint"), + Self::Batch => serializer.serialize_unit_variant("DeploymentType", 2u32, "Batch"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ServiceResponseBaseUnion { + #[serde(rename = "ACI")] + Aci(AciServiceResponse), + Custom(AksVariantResponse), +} +#[doc = "Details of customized scripts to execute for setting up the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SetupScripts { + #[doc = "Customized setup scripts"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scripts: Option, +} +impl SetupScripts { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SharedPrivateLinkResource { + #[doc = "Unique name of the private link."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Properties of a shared private link resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SharedPrivateLinkResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a shared private link resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SharedPrivateLinkResourceProperty { + #[doc = "The resource id that private link links to."] + #[serde(rename = "privateLinkResourceId", default, skip_serializing_if = "Option::is_none")] + pub private_link_resource_id: Option, + #[doc = "The private link resource group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "Request message."] + #[serde(rename = "requestMessage", default, skip_serializing_if = "Option::is_none")] + pub request_message: Option, + #[doc = "The private endpoint connection status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl SharedPrivateLinkResourceProperty { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Sku of the resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Sku { + #[doc = "Name of the sku"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Tier of the sku like Basic or Enterprise"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, +} +impl Sku { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of skus with features"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SkuListResult { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of Workspace Skus. Call ListNext() with this URI to fetch the next page of Workspace Skus"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SkuListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl SkuListResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SparkMavenPackage { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub artifact: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl SparkMavenPackage { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The ssl configuration for scoring"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SslConfiguration { + #[doc = "Enable or disable ssl for scoring"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Cert data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cert: Option, + #[doc = "Key data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + #[doc = "CNAME of the cert"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cname: Option, + #[doc = "Leaf domain label of public endpoint"] + #[serde(rename = "leafDomainLabel", default, skip_serializing_if = "Option::is_none")] + pub leaf_domain_label: Option, + #[doc = "Indicates whether to overwrite existing domain label."] + #[serde(rename = "overwriteExistingDomain", default, skip_serializing_if = "Option::is_none")] + pub overwrite_existing_domain: Option, +} +impl SslConfiguration { + pub fn new() -> Self { + Self::default() + } +} +pub mod ssl_configuration { + use super::*; + #[doc = "Enable or disable ssl for scoring"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + Disabled, + Enabled, + Auto, + } +} +#[doc = "A SynapseSpark compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SynapseSpark { + #[serde(flatten)] + pub compute: Compute, + #[serde(flatten)] + pub synapse_spark_pool_properties: SynapseSparkPoolProperties, +} +impl SynapseSpark { + pub fn new(compute: Compute) -> Self { + Self { + compute, + synapse_spark_pool_properties: SynapseSparkPoolProperties::default(), + } + } +} +#[doc = "Properties specific to Synapse Spark pools."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SynapseSparkPoolProperties { + #[doc = "AKS properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SynapseSparkPoolProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod synapse_spark_pool_properties { + use super::*; + #[doc = "AKS properties"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Auto scale properties"] + #[serde(rename = "autoScaleProperties", default, skip_serializing_if = "Option::is_none")] + pub auto_scale_properties: Option, + #[doc = "Auto pause properties"] + #[serde(rename = "autoPauseProperties", default, skip_serializing_if = "Option::is_none")] + pub auto_pause_properties: Option, + #[doc = "Spark version."] + #[serde(rename = "sparkVersion", default, skip_serializing_if = "Option::is_none")] + pub spark_version: Option, + #[doc = "The number of compute nodes currently assigned to the compute."] + #[serde(rename = "nodeCount", default, skip_serializing_if = "Option::is_none")] + pub node_count: Option, + #[doc = "Node size."] + #[serde(rename = "nodeSize", default, skip_serializing_if = "Option::is_none")] + pub node_size: Option, + #[doc = "Node size family."] + #[serde(rename = "nodeSizeFamily", default, skip_serializing_if = "Option::is_none")] + pub node_size_family: Option, + #[doc = "Azure subscription identifier."] + #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] + pub subscription_id: Option, + #[doc = "Name of the resource group in which workspace is located."] + #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] + pub resource_group: Option, + #[doc = "Name of Azure Machine Learning workspace."] + #[serde(rename = "workspaceName", default, skip_serializing_if = "Option::is_none")] + pub workspace_name: Option, + #[doc = "Pool name."] + #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] + pub pool_name: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Read only system data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "An identifier for the identity that created the resource"] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that creates/modifies resources"] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)"] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "An identifier for the identity that last modified the resource"] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that creates/modifies resources"] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A system service running on a compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemService { + #[doc = "The type of this system service."] + #[serde(rename = "systemServiceType", default, skip_serializing_if = "Option::is_none")] + pub system_service_type: Option, + #[doc = "Public IP address"] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, + #[doc = "The version for this type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl SystemService { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties for update Quota response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateWorkspaceQuotas { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The maximum permitted quota of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "An enum describing the unit of quota measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "Status of update workspace quota."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl UpdateWorkspaceQuotas { + pub fn new() -> Self { + Self::default() + } +} +pub mod update_workspace_quotas { + use super::*; + #[doc = "An enum describing the unit of quota measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Status of update workspace quota."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Undefined, + Success, + Failure, + InvalidQuotaBelowClusterMinimum, + InvalidQuotaExceedsSubscriptionLimit, + #[serde(rename = "InvalidVMFamilyName")] + InvalidVmFamilyName, + OperationNotSupportedForSku, + OperationNotEnabledForRegion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Undefined => serializer.serialize_unit_variant("Status", 0u32, "Undefined"), + Self::Success => serializer.serialize_unit_variant("Status", 1u32, "Success"), + Self::Failure => serializer.serialize_unit_variant("Status", 2u32, "Failure"), + Self::InvalidQuotaBelowClusterMinimum => { + serializer.serialize_unit_variant("Status", 3u32, "InvalidQuotaBelowClusterMinimum") + } + Self::InvalidQuotaExceedsSubscriptionLimit => { + serializer.serialize_unit_variant("Status", 4u32, "InvalidQuotaExceedsSubscriptionLimit") + } + Self::InvalidVmFamilyName => serializer.serialize_unit_variant("Status", 5u32, "InvalidVMFamilyName"), + Self::OperationNotSupportedForSku => serializer.serialize_unit_variant("Status", 6u32, "OperationNotSupportedForSku"), + Self::OperationNotEnabledForRegion => serializer.serialize_unit_variant("Status", 7u32, "OperationNotEnabledForRegion"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The result of update workspace quota."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateWorkspaceQuotasResult { + #[doc = "The list of workspace quota update result."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl UpdateWorkspaceQuotasResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes AML Resource Usage."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Usage { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Region of the AML workspace in the id."] + #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] + pub aml_workspace_location: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "An enum describing the unit of usage measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "The current usage of the resource."] + #[serde(rename = "currentValue", default, skip_serializing_if = "Option::is_none")] + pub current_value: Option, + #[doc = "The maximum permitted usage of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "The Usage Names."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl Usage { + pub fn new() -> Self { + Self::default() + } +} +pub mod usage { + use super::*; + #[doc = "An enum describing the unit of usage measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The Usage Names."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UsageName { + #[doc = "The name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The localized name of the resource."] + #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] + pub localized_value: Option, +} +impl UsageName { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Settings for user account that gets created on each on the nodes of a compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserAccountCredentials { + #[doc = "Name of the administrator user account which can be used to SSH to nodes."] + #[serde(rename = "adminUserName")] + pub admin_user_name: String, + #[doc = "SSH public key of the administrator user account."] + #[serde(rename = "adminUserSshPublicKey", default, skip_serializing_if = "Option::is_none")] + pub admin_user_ssh_public_key: Option, + #[doc = "Password of the administrator user account."] + #[serde(rename = "adminUserPassword", default, skip_serializing_if = "Option::is_none")] + pub admin_user_password: Option, +} +impl UserAccountCredentials { + pub fn new(admin_user_name: String) -> Self { + Self { + admin_user_name, + admin_user_ssh_public_key: None, + admin_user_password: None, + } + } +} +#[doc = "dictionary containing all the user assigned identities, with resourceId of the UAI as key."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User Assigned Identity"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the user assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of the user assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The clientId(aka appId) of the user assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A Machine Learning compute based on Azure Virtual Machines."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachine { + #[serde(flatten)] + pub compute: Compute, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl VirtualMachine { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod virtual_machine { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Virtual Machine size"] + #[serde(rename = "virtualMachineSize", default, skip_serializing_if = "Option::is_none")] + pub virtual_machine_size: Option, + #[doc = "Port open for ssh connections."] + #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] + pub ssh_port: Option, + #[doc = "Public IP address of the virtual machine."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[doc = "Admin credentials for virtual machine"] + #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] + pub administrator_account: Option, + #[doc = "Indicates whether this compute will be used for running notebooks."] + #[serde(rename = "isNotebookInstanceCompute", default, skip_serializing_if = "Option::is_none")] + pub is_notebook_instance_compute: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Virtual Machine image for Windows AML Compute"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachineImage { + #[doc = "Virtual Machine image path"] + pub id: String, +} +impl VirtualMachineImage { + pub fn new(id: String) -> Self { + Self { id } + } +} +#[doc = "Secrets related to a Machine Learning compute based on AKS."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachineSecrets { + #[serde(flatten)] + pub compute_secrets: ComputeSecrets, + #[doc = "Admin credentials for virtual machine"] + #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] + pub administrator_account: Option, +} +impl VirtualMachineSecrets { + pub fn new(compute_secrets: ComputeSecrets) -> Self { + Self { + compute_secrets, + administrator_account: None, + } + } +} +#[doc = "Describes the properties of a VM size."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineSize { + #[doc = "The name of the virtual machine size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The family name of the virtual machine size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family: Option, + #[doc = "The number of vCPUs supported by the virtual machine size."] + #[serde(rename = "vCPUs", default, skip_serializing_if = "Option::is_none")] + pub v_cp_us: Option, + #[doc = "The number of gPUs supported by the virtual machine size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gpus: Option, + #[doc = "The OS VHD disk size, in MB, allowed by the virtual machine size."] + #[serde(rename = "osVhdSizeMB", default, skip_serializing_if = "Option::is_none")] + pub os_vhd_size_mb: Option, + #[doc = "The resource volume size, in MB, allowed by the virtual machine size."] + #[serde(rename = "maxResourceVolumeMB", default, skip_serializing_if = "Option::is_none")] + pub max_resource_volume_mb: Option, + #[doc = "The amount of memory, in GB, supported by the virtual machine size."] + #[serde(rename = "memoryGB", default, skip_serializing_if = "Option::is_none")] + pub memory_gb: Option, + #[doc = "Specifies if the virtual machine size supports low priority VMs."] + #[serde(rename = "lowPriorityCapable", default, skip_serializing_if = "Option::is_none")] + pub low_priority_capable: Option, + #[doc = "Specifies if the virtual machine size supports premium IO."] + #[serde(rename = "premiumIO", default, skip_serializing_if = "Option::is_none")] + pub premium_io: Option, + #[doc = "The estimated price info for using a VM."] + #[serde(rename = "estimatedVMPrices", default, skip_serializing_if = "Option::is_none")] + pub estimated_vm_prices: Option, + #[doc = "Specifies the compute types supported by the virtual machine size."] + #[serde( + rename = "supportedComputeTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_compute_types: Vec, +} +impl VirtualMachineSize { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List Virtual Machine size operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineSizeListResult { + #[doc = "The list of virtual machine sizes supported by AmlCompute."] + #[serde( + rename = "amlCompute", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub aml_compute: Vec, +} +impl VirtualMachineSizeListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Admin credentials for virtual machine"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineSshCredentials { + #[doc = "Username of admin account"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "Password of admin account"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, + #[doc = "Public key data"] + #[serde(rename = "publicKeyData", default, skip_serializing_if = "Option::is_none")] + pub public_key_data: Option, + #[doc = "Private key data"] + #[serde(rename = "privateKeyData", default, skip_serializing_if = "Option::is_none")] + pub private_key_data: Option, +} +impl VirtualMachineSshCredentials { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VnetConfiguration { + #[doc = "The name of the virtual network."] + #[serde(rename = "vnetName", default, skip_serializing_if = "Option::is_none")] + pub vnet_name: Option, + #[doc = "The name of the virtual network subnet."] + #[serde(rename = "subnetName", default, skip_serializing_if = "Option::is_none")] + pub subnet_name: Option, +} +impl VnetConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An object that represents a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Workspace { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The properties of a machine learning workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Workspace { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Workspace connection."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceConnection { + #[doc = "ResourceId of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Friendly name of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type of workspace connection."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Workspace Connection specific properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceConnection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "object used for creating workspace connection."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceConnectionDto { + #[doc = "Friendly name of the workspace connection"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Workspace Connection specific properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceConnectionDto { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Workspace Connection specific properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceConnectionProps { + #[doc = "Category of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "Target of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "Authorization type of the workspace connection."] + #[serde(rename = "authType", default, skip_serializing_if = "Option::is_none")] + pub auth_type: Option, + #[doc = "Value details of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "format for the workspace connection value"] + #[serde(rename = "valueFormat", default, skip_serializing_if = "Option::is_none")] + pub value_format: Option, +} +impl WorkspaceConnectionProps { + pub fn new() -> Self { + Self::default() + } +} +pub mod workspace_connection_props { + use super::*; + #[doc = "format for the workspace connection value"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ValueFormat")] + pub enum ValueFormat { + #[serde(rename = "JSON")] + Json, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ValueFormat { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ValueFormat { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ValueFormat { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Json => serializer.serialize_unit_variant("ValueFormat", 0u32, "JSON"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The result of a request to list machine learning workspaces."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceListResult { + #[doc = "The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI that can be used to request the next list of machine learning workspaces."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl WorkspaceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceProperties { + #[doc = "The immutable id associated with this workspace."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The description of this workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The friendly name for this workspace. This name in mutable"] + #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] + pub key_vault: Option, + #[doc = "ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] + pub application_insights: Option, + #[doc = "ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] + pub container_registry: Option, + #[doc = "ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] + pub storage_account: Option, + #[doc = "Url for the discovery service to identify regional endpoints for machine learning experimentation services"] + #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] + pub discovery_url: Option, + #[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encryption: Option, + #[doc = "The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service"] + #[serde(rename = "hbiWorkspace", default, skip_serializing_if = "Option::is_none")] + pub hbi_workspace: Option, + #[doc = "The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace"] + #[serde(rename = "serviceProvisionedResourceGroup", default, skip_serializing_if = "Option::is_none")] + pub service_provisioned_resource_group: Option, + #[doc = "Count of private connections in the workspace"] + #[serde(rename = "privateLinkCount", default, skip_serializing_if = "Option::is_none")] + pub private_link_count: Option, + #[doc = "The compute name for image build"] + #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] + pub image_build_compute: Option, + #[doc = "The flag to indicate whether to allow public access when behind VNet."] + #[serde(rename = "allowPublicAccessWhenBehindVnet", default, skip_serializing_if = "Option::is_none")] + pub allow_public_access_when_behind_vnet: Option, + #[doc = "The list of private endpoint connections in the workspace."] + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "The list of shared private link resources in this workspace."] + #[serde( + rename = "sharedPrivateLinkResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub shared_private_link_resources: Vec, + #[serde(rename = "notebookInfo", default, skip_serializing_if = "Option::is_none")] + pub notebook_info: Option, + #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] + pub service_managed_resources_settings: Option, + #[doc = "The user assigned identity resource id that represents the workspace identity."] + #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub primary_user_assigned_identity: Option, + #[doc = "The tenant id associated with this workspace."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, +} +impl WorkspaceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod workspace_properties { + use super::*; + #[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Unknown, + Updating, + Creating, + Deleting, + Succeeded, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The parameters for updating the properties of a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspacePropertiesUpdateParameters { + #[doc = "The description of this workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The friendly name for this workspace."] + #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The compute name for image build"] + #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] + pub image_build_compute: Option, + #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] + pub service_managed_resources_settings: Option, + #[doc = "The user assigned identity resource id that represents the workspace identity."] + #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub primary_user_assigned_identity: Option, +} +impl WorkspacePropertiesUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes Workspace Sku details and features"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceSku { + #[doc = "The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.)."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub locations: Vec, + #[doc = "A list of locations and availability zones in those locations where the SKU is available."] + #[serde( + rename = "locationInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub location_info: Vec, + #[doc = "Sku Tier like Basic or Enterprise"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, + #[serde(rename = "resourceType", default, skip_serializing_if = "Option::is_none")] + pub resource_type: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "List of features/user capabilities associated with the sku"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub capabilities: Vec, + #[doc = "The restrictions because of which SKU cannot be used. This is empty if there are no restrictions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub restrictions: Vec, +} +impl WorkspaceSku { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The parameters for updating a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceUpdateParameters { + #[doc = "The resource tags for the machine learning workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Sku of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "The parameters for updating the properties of a machine learning workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} diff --git a/services/mgmt/machinelearningservices/src/package_2021_07_01/mod.rs b/services/mgmt/machinelearningservices/src/package_2021_07_01/mod.rs new file mode 100644 index 0000000000..c2edacd131 --- /dev/null +++ b/services/mgmt/machinelearningservices/src/package_2021_07_01/mod.rs @@ -0,0 +1,5528 @@ +#![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, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + 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) -> 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) -> 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) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> 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 { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + 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 compute_client(&self) -> compute::Client { + compute::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { + private_endpoint_connections::Client(self.clone()) + } + pub fn private_link_resources_client(&self) -> private_link_resources::Client { + private_link_resources::Client(self.clone()) + } + pub fn quotas_client(&self) -> quotas::Client { + quotas::Client(self.clone()) + } + pub fn usages_client(&self) -> usages::Client { + usages::Client(self.clone()) + } + pub fn virtual_machine_sizes_client(&self) -> virtual_machine_sizes::Client { + virtual_machine_sizes::Client(self.clone()) + } + pub fn workspace_connections_client(&self) -> workspace_connections::Client { + workspace_connections::Client(self.clone()) + } + pub fn workspace_features_client(&self) -> workspace_features::Client { + workspace_features::Client(self.clone()) + } + pub fn workspace_skus_client(&self) -> workspace_skus::Client { + workspace_skus::Client(self.clone()) + } + pub fn workspaces_client(&self) -> workspaces::Client { + workspaces::Client(self.clone()) + } +} +pub mod operations { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available Azure Machine Learning Workspaces REST API operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = ""] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.MachineLearningServices/operations", + self.client.endpoint(), + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} +pub mod workspaces { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the properties of the specified machine learning workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Creates or updates a workspace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `parameters`: The parameters for creating or updating a machine learning workspace."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates a machine learning workspace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `parameters`: The parameters for updating a machine learning workspace."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a machine learning workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Lists all the available machine learning workspaces under the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> 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(), + skip: None, + } + } + #[doc = "Diagnose workspace setup issue."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn diagnose( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> diagnose::RequestBuilder { + diagnose::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + parameters: None, + } + } + #[doc = "Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn resync_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> resync_keys::RequestBuilder { + resync_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Lists all the available machine learning workspaces under the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + skip: None, + } + } + #[doc = "return notebook access token and refresh token"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_notebook_access_token( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_notebook_access_token::RequestBuilder { + list_notebook_access_token::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Prepare a notebook."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn prepare_notebook( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> prepare_notebook::RequestBuilder { + prepare_notebook::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "List storage account keys of a workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_storage_account_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_storage_account_keys::RequestBuilder { + list_storage_account_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "List keys of a notebook."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_notebook_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_notebook_keys::RequestBuilder { + list_notebook_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list_outbound_network_dependencies_endpoints( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_outbound_network_dependencies_endpoints::RequestBuilder { + list_outbound_network_dependencies_endpoints::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) parameters: models::Workspace, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) parameters: models::WorkspaceUpdateParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod list_by_resource_group { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-07-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod diagnose { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) parameters: Option, + } + impl RequestBuilder { + #[doc = "The parameter of diagnosing workspace health"] + pub fn parameters(mut self, parameters: impl Into) -> Self { + self.parameters = Some(parameters.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = if let Some(parameters) = &this.parameters { + req.insert_header("content-type", "application/json"); + azure_core::to_json(parameters)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/diagnose", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListWorkspaceKeysResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod resync_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/resyncKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod list_by_subscription { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-07-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/workspaces", + self.client.endpoint(), + &self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod list_notebook_access_token { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NotebookAccessTokenResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookAccessToken" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod prepare_notebook { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NotebookResourceInfo = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/prepareNotebook", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{ + get_retry_after, + location::{get_location, get_provisioning_state, FinalState}, + LroStatus, + }, + sleep::sleep, + }; + use std::time::Duration; + let this = self.clone(); + let response = this.send().await?; + let headers = response.as_raw_response().headers(); + let location = get_location(headers, FinalState::Location)?; + if let Some(url) = location { + loop { + let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); + let credential = self.client.token_credential(); + let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let response = self.client.send(&mut req).await?; + let headers = response.headers(); + let retry_after = get_retry_after(headers); + let bytes = response.into_body().collect().await?; + let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { + Error::message( + ErrorKind::Other, + "Long running operation failed (missing provisioning state)".to_string(), + ) + })?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => { + let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); + let credential = self.client.token_credential(); + let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let response = self.client.send(&mut req).await?; + return Response(response).into_body().await; + } + LroStatus::Failed => { + return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) + } + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + } else { + response.into_body().await + } + }) + } + } + } + pub mod list_storage_account_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListStorageAccountKeysResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listStorageAccountKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_notebook_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListNotebookKeysResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_outbound_network_dependencies_endpoints { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalFqdnResponse = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundNetworkDependenciesEndpoints" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod usages { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the current usage information as well as limits for AML resources for given subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The location for which resource usage is queried."] + pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListUsagesResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-07-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/usages", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} +pub mod virtual_machine_sizes { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns supported VM Sizes in a location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `location`: The location upon which virtual-machine-sizes is queried."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list(&self, location: impl Into, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + location: location.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VirtualMachineSizeListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) location: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/vmSizes", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod quotas { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Update quota for each VM family in workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `location`: The location for update quota is queried."] + #[doc = "* `parameters`: Quota update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + location: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + location: location.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the currently assigned Workspace Quotas based on VMFamily."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The location for which resource usage is queried."] + pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + } + pub mod update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UpdateWorkspaceQuotasResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) location: String, + pub(crate) parameters: models::QuotaUpdateParameters, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/updateQuotas", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListWorkspaceQuotas = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-07-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/quotas", + self.client.endpoint(), + &self.subscription_id, + &self.location + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} +pub mod compute { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets computes in specified workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + } + } + #[doc = "Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + #[doc = "* `parameters`: Payload with Machine Learning compute definition."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + #[doc = "* `parameters`: Additional parameters for cluster update."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes specified Machine Learning compute."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + #[doc = "* `underlying_resource_action`: Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + underlying_resource_action: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + underlying_resource_action: underlying_resource_action.into(), + } + } + #[doc = "Get the details (e.g IP address, port etc) of all the compute nodes in the compute."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn list_nodes( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> list_nodes::RequestBuilder { + list_nodes::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Gets secrets related to Machine Learning compute (storage keys, service credentials, etc)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Posts a start action to a compute instance"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn start( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> start::RequestBuilder { + start::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Posts a stop action to a compute instance"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn stop( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> stop::RequestBuilder { + stop::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + #[doc = "Posts a restart action to a compute instance"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] + pub fn restart( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + compute_name: impl Into, + ) -> restart::RequestBuilder { + restart::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + compute_name: compute_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PaginatedComputeResourcesList = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-07-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeResource = 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 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + pub(crate) parameters: models::ComputeResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + pub(crate) parameters: models::ClusterUpdateParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + pub(crate) underlying_resource_action: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let underlying_resource_action = &this.underlying_resource_action; + req.url_mut() + .query_pairs_mut() + .append_pair("underlyingResourceAction", underlying_resource_action); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod list_nodes { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AmlComputeNodesInformation = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + 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()), + ); + 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, "2021-07-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::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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listNodes", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComputeSecretsUnion = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listKeys", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod start { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/start", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod stop { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/stop", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod restart { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) compute_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/restart", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.compute_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} +pub mod private_endpoint_connections { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the private endpoint connections associated with the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the specified private endpoint connection associated with the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + #[doc = "Update the state of specified private endpoint connection associated with the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] + #[doc = "* `properties`: The private endpoint connection properties."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + private_endpoint_connection_name: impl Into, + properties: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + properties: properties.into(), + } + } + #[doc = "Deletes the specified private endpoint connection associated with the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnectionListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + 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 = ""] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) properties: models::PrivateEndpointConnection, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} +pub mod private_link_resources { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the private link resources that need to be created for a workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResourceListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateLinkResources", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_connections { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all connections under a AML workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + target: None, + category: None, + } + } + #[doc = "Get the detail of a workspace connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `connection_name`: Friendly name of the workspace connection"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + connection_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + connection_name: connection_name.into(), + } + } + #[doc = "Add a new workspace connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `connection_name`: Friendly name of the workspace connection"] + #[doc = "* `parameters`: The object for creating or updating a new workspace connection"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + connection_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + connection_name: connection_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Delete a workspace connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `connection_name`: Friendly name of the workspace connection"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + connection_name: connection_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PaginatedWorkspaceConnectionsList = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) target: Option, + pub(crate) category: Option, + } + impl RequestBuilder { + #[doc = "Target of the workspace connection."] + pub fn target(mut self, target: impl Into) -> Self { + self.target = Some(target.into()); + self + } + #[doc = "Category of the workspace connection."] + pub fn category(mut self, category: impl Into) -> Self { + self.category = Some(category.into()); + self + } + #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = ""] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + if let Some(target) = &this.target { + req.url_mut().query_pairs_mut().append_pair("target", target); + } + if let Some(category) = &this.category { + req.url_mut().query_pairs_mut().append_pair("category", category); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.connection_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceConnection = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) connection_name: String, + pub(crate) parameters: models::WorkspaceConnection, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.connection_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.connection_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} +pub mod workspace_features { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all enabled features for a workspace"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListAmlUserFeatureResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-07-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/features", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} +pub mod workspace_skus { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all skus with associated features"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SkuListResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2021-07-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()), + ); + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/workspaces/skus", + self.client.endpoint(), + &self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01"); + } + Ok(url) + } + } + } +} diff --git a/services/mgmt/machinelearningservices/src/package_2021_07_01/models.rs b/services/mgmt/machinelearningservices/src/package_2021_07_01/models.rs new file mode 100644 index 0000000000..b192d57b4a --- /dev/null +++ b/services/mgmt/machinelearningservices/src/package_2021_07_01/models.rs @@ -0,0 +1,4412 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "A Machine Learning compute based on AKS."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Aks { + #[serde(flatten)] + pub compute: Compute, + #[doc = "AKS properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Aks { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod aks { + use super::*; + #[doc = "AKS properties"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Cluster full qualified domain name"] + #[serde(rename = "clusterFqdn", default, skip_serializing_if = "Option::is_none")] + pub cluster_fqdn: Option, + #[doc = "System services"] + #[serde( + rename = "systemServices", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub system_services: Vec, + #[doc = "Number of agents"] + #[serde(rename = "agentCount", default, skip_serializing_if = "Option::is_none")] + pub agent_count: Option, + #[doc = "Agent virtual machine size"] + #[serde(rename = "agentVmSize", default, skip_serializing_if = "Option::is_none")] + pub agent_vm_size: Option, + #[doc = "Intended usage of the cluster"] + #[serde(rename = "clusterPurpose", default, skip_serializing_if = "Option::is_none")] + pub cluster_purpose: Option, + #[doc = "The ssl configuration for scoring"] + #[serde(rename = "sslConfiguration", default, skip_serializing_if = "Option::is_none")] + pub ssl_configuration: Option, + #[doc = "Advance configuration for AKS networking"] + #[serde(rename = "aksNetworkingConfiguration", default, skip_serializing_if = "Option::is_none")] + pub aks_networking_configuration: Option, + #[doc = "Load Balancer Type"] + #[serde(rename = "loadBalancerType", default, skip_serializing_if = "Option::is_none")] + pub load_balancer_type: Option, + #[doc = "Load Balancer Subnet"] + #[serde(rename = "loadBalancerSubnet", default, skip_serializing_if = "Option::is_none")] + pub load_balancer_subnet: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } + pub mod properties { + use super::*; + #[doc = "Intended usage of the cluster"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ClusterPurpose")] + pub enum ClusterPurpose { + FastProd, + DenseProd, + DevTest, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ClusterPurpose { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ClusterPurpose { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ClusterPurpose { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::FastProd => serializer.serialize_unit_variant("ClusterPurpose", 0u32, "FastProd"), + Self::DenseProd => serializer.serialize_unit_variant("ClusterPurpose", 1u32, "DenseProd"), + Self::DevTest => serializer.serialize_unit_variant("ClusterPurpose", 2u32, "DevTest"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ClusterPurpose { + fn default() -> Self { + Self::FastProd + } + } + #[doc = "Load Balancer Type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LoadBalancerType")] + pub enum LoadBalancerType { + PublicIp, + InternalLoadBalancer, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LoadBalancerType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LoadBalancerType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LoadBalancerType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::PublicIp => serializer.serialize_unit_variant("LoadBalancerType", 0u32, "PublicIp"), + Self::InternalLoadBalancer => serializer.serialize_unit_variant("LoadBalancerType", 1u32, "InternalLoadBalancer"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for LoadBalancerType { + fn default() -> Self { + Self::PublicIp + } + } + } +} +#[doc = "Secrets related to a Machine Learning compute based on AKS."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AksComputeSecrets { + #[serde(flatten)] + pub compute_secrets: ComputeSecrets, + #[serde(flatten)] + pub aks_compute_secrets_properties: AksComputeSecretsProperties, +} +impl AksComputeSecrets { + pub fn new(compute_secrets: ComputeSecrets) -> Self { + Self { + compute_secrets, + aks_compute_secrets_properties: AksComputeSecretsProperties::default(), + } + } +} +#[doc = "Properties of AksComputeSecrets"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AksComputeSecretsProperties { + #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] + #[serde(rename = "userKubeConfig", default, skip_serializing_if = "Option::is_none")] + pub user_kube_config: Option, + #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] + #[serde(rename = "adminKubeConfig", default, skip_serializing_if = "Option::is_none")] + pub admin_kube_config: Option, + #[doc = "Image registry pull secret."] + #[serde(rename = "imagePullSecretName", default, skip_serializing_if = "Option::is_none")] + pub image_pull_secret_name: Option, +} +impl AksComputeSecretsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Advance configuration for AKS networking"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AksNetworkingConfiguration { + #[doc = "Virtual network subnet resource ID the compute nodes belong to"] + #[serde(rename = "subnetId", default, skip_serializing_if = "Option::is_none")] + pub subnet_id: Option, + #[doc = "A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges."] + #[serde(rename = "serviceCidr", default, skip_serializing_if = "Option::is_none")] + pub service_cidr: Option, + #[doc = "An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr."] + #[serde(rename = "dnsServiceIP", default, skip_serializing_if = "Option::is_none")] + pub dns_service_ip: Option, + #[doc = "A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range."] + #[serde(rename = "dockerBridgeCidr", default, skip_serializing_if = "Option::is_none")] + pub docker_bridge_cidr: Option, +} +impl AksNetworkingConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An Azure Machine Learning compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmlCompute { + #[serde(flatten)] + pub compute: Compute, + #[doc = "AML Compute properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AmlCompute { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +#[doc = "Compute node information related to a AmlCompute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AmlComputeNodeInformation { + #[doc = "ID of the compute node."] + #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")] + pub node_id: Option, + #[doc = "Private IP address of the compute node."] + #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, + #[doc = "Public IP address of the compute node."] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, + #[doc = "SSH port number of the node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] + #[serde(rename = "nodeState", default, skip_serializing_if = "Option::is_none")] + pub node_state: Option, + #[doc = "ID of the Experiment running on the node, if any else null."] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option, +} +impl AmlComputeNodeInformation { + pub fn new() -> Self { + Self::default() + } +} +pub mod aml_compute_node_information { + use super::*; + #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "NodeState")] + pub enum NodeState { + #[serde(rename = "idle")] + Idle, + #[serde(rename = "running")] + Running, + #[serde(rename = "preparing")] + Preparing, + #[serde(rename = "unusable")] + Unusable, + #[serde(rename = "leaving")] + Leaving, + #[serde(rename = "preempted")] + Preempted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for NodeState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for NodeState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for NodeState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Idle => serializer.serialize_unit_variant("NodeState", 0u32, "idle"), + Self::Running => serializer.serialize_unit_variant("NodeState", 1u32, "running"), + Self::Preparing => serializer.serialize_unit_variant("NodeState", 2u32, "preparing"), + Self::Unusable => serializer.serialize_unit_variant("NodeState", 3u32, "unusable"), + Self::Leaving => serializer.serialize_unit_variant("NodeState", 4u32, "leaving"), + Self::Preempted => serializer.serialize_unit_variant("NodeState", 5u32, "preempted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of AmlCompute Nodes"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AmlComputeNodesInformation { + #[doc = "The collection of returned AmlCompute nodes details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub nodes: Vec, + #[doc = "The continuation token."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AmlComputeNodesInformation { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl AmlComputeNodesInformation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AML Compute properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AmlComputeProperties { + #[doc = "Compute OS Type"] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "Virtual Machine Size"] + #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] + pub vm_size: Option, + #[doc = "Virtual Machine priority"] + #[serde(rename = "vmPriority", default, skip_serializing_if = "Option::is_none")] + pub vm_priority: Option, + #[doc = "Virtual Machine image for Windows AML Compute"] + #[serde(rename = "virtualMachineImage", default, skip_serializing_if = "Option::is_none")] + pub virtual_machine_image: Option, + #[doc = "Network is isolated or not"] + #[serde(rename = "isolatedNetwork", default, skip_serializing_if = "Option::is_none")] + pub isolated_network: Option, + #[doc = "scale settings for AML Compute"] + #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] + pub scale_settings: Option, + #[doc = "Settings for user account that gets created on each on the nodes of a compute."] + #[serde(rename = "userAccountCredentials", default, skip_serializing_if = "Option::is_none")] + pub user_account_credentials: Option, + #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subnet: Option, + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] + #[serde(rename = "remoteLoginPortPublicAccess", default, skip_serializing_if = "Option::is_none")] + pub remote_login_port_public_access: Option, + #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] + #[serde(rename = "allocationState", default, skip_serializing_if = "Option::is_none")] + pub allocation_state: Option, + #[doc = "The time at which the compute entered its current allocation state."] + #[serde(rename = "allocationStateTransitionTime", default, with = "azure_core::date::rfc3339::option")] + pub allocation_state_transition_time: Option, + #[doc = "Collection of errors encountered by various compute nodes during node setup."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, + #[doc = "The number of compute nodes currently assigned to the compute."] + #[serde(rename = "currentNodeCount", default, skip_serializing_if = "Option::is_none")] + pub current_node_count: Option, + #[doc = "The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation."] + #[serde(rename = "targetNodeCount", default, skip_serializing_if = "Option::is_none")] + pub target_node_count: Option, + #[doc = "Counts of various compute node states on the amlCompute."] + #[serde(rename = "nodeStateCounts", default, skip_serializing_if = "Option::is_none")] + pub node_state_counts: Option, + #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] + #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] + pub enable_node_public_ip: Option, +} +impl AmlComputeProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod aml_compute_properties { + use super::*; + #[doc = "Compute OS Type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OsType")] + pub enum OsType { + Linux, + Windows, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OsType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OsType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OsType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), + Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for OsType { + fn default() -> Self { + Self::Linux + } + } + #[doc = "Virtual Machine priority"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "VmPriority")] + pub enum VmPriority { + Dedicated, + LowPriority, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for VmPriority { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for VmPriority { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for VmPriority { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Dedicated => serializer.serialize_unit_variant("VmPriority", 0u32, "Dedicated"), + Self::LowPriority => serializer.serialize_unit_variant("VmPriority", 1u32, "LowPriority"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "RemoteLoginPortPublicAccess")] + pub enum RemoteLoginPortPublicAccess { + Enabled, + Disabled, + NotSpecified, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for RemoteLoginPortPublicAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for RemoteLoginPortPublicAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for RemoteLoginPortPublicAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 1u32, "Disabled"), + Self::NotSpecified => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 2u32, "NotSpecified"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for RemoteLoginPortPublicAccess { + fn default() -> Self { + Self::NotSpecified + } + } + #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AllocationState")] + pub enum AllocationState { + Steady, + Resizing, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AllocationState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AllocationState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AllocationState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Steady => serializer.serialize_unit_variant("AllocationState", 0u32, "Steady"), + Self::Resizing => serializer.serialize_unit_variant("AllocationState", 1u32, "Resizing"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Features enabled for a workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AmlUserFeature { + #[doc = "Specifies the feature ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Specifies the feature name "] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Describes the feature for user experience"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl AmlUserFeature { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A user that can be assigned to a compute instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssignedUser { + #[doc = "User’s AAD Object Id."] + #[serde(rename = "objectId")] + pub object_id: String, + #[doc = "User’s AAD Tenant Id."] + #[serde(rename = "tenantId")] + pub tenant_id: String, +} +impl AssignedUser { + pub fn new(object_id: String, tenant_id: String) -> Self { + Self { object_id, tenant_id } + } +} +#[doc = "Auto pause properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoPauseProperties { + #[serde(rename = "delayInMinutes", default, skip_serializing_if = "Option::is_none")] + pub delay_in_minutes: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl AutoPauseProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Auto scale properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoScaleProperties { + #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] + pub min_node_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "maxNodeCount", default, skip_serializing_if = "Option::is_none")] + pub max_node_count: Option, +} +impl AutoScaleProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AmlCompute update parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterUpdateParameters { + #[doc = "The properties of a amlCompute that need to be updated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ClusterUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a amlCompute that need to be updated."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterUpdateProperties { + #[doc = "Desired scale settings for the amlCompute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ClusterUpdateProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Machine Learning compute object."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Compute { + #[doc = "The type of compute"] + #[serde(rename = "computeType")] + pub compute_type: ComputeType, + #[doc = "Location for the underlying compute"] + #[serde(rename = "computeLocation", default, skip_serializing_if = "Option::is_none")] + pub compute_location: Option, + #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The description of the Machine Learning compute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The time at which the compute was created."] + #[serde(rename = "createdOn", default, with = "azure_core::date::rfc3339::option")] + pub created_on: Option, + #[doc = "The time at which the compute was last modified."] + #[serde(rename = "modifiedOn", default, with = "azure_core::date::rfc3339::option")] + pub modified_on: Option, + #[doc = "ARM resource id of the underlying compute"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Errors during provisioning"] + #[serde( + rename = "provisioningErrors", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub provisioning_errors: Vec, + #[doc = "Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false."] + #[serde(rename = "isAttachedCompute", default, skip_serializing_if = "Option::is_none")] + pub is_attached_compute: Option, + #[doc = "Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, +} +impl Compute { + pub fn new(compute_type: ComputeType) -> Self { + Self { + compute_type, + compute_location: None, + provisioning_state: None, + description: None, + created_on: None, + modified_on: None, + resource_id: None, + provisioning_errors: Vec::new(), + is_attached_compute: None, + disable_local_auth: None, + } + } +} +pub mod compute { + use super::*; + #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Unknown, + Updating, + Creating, + Deleting, + Succeeded, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ComputeUnion { + #[serde(rename = "AKS")] + Aks(Aks), + AmlCompute(AmlCompute), + ComputeInstance(ComputeInstance), + DataFactory(DataFactory), + DataLakeAnalytics(DataLakeAnalytics), + Databricks(Databricks), + #[serde(rename = "HDInsight")] + HdInsight(HdInsight), + Kubernetes(Kubernetes), + SynapseSpark(SynapseSpark), + VirtualMachine(VirtualMachine), +} +#[doc = "An Azure Machine Learning compute instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ComputeInstance { + #[serde(flatten)] + pub compute: Compute, + #[doc = "Compute Instance properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ComputeInstance { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +#[doc = "Defines an Aml Instance application and its connectivity endpoint URI."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceApplication { + #[doc = "Name of the ComputeInstance application."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Application' endpoint URI."] + #[serde(rename = "endpointUri", default, skip_serializing_if = "Option::is_none")] + pub endpoint_uri: Option, +} +impl ComputeInstanceApplication { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceConnectivityEndpoints { + #[doc = "Public IP Address of this ComputeInstance."] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, + #[doc = "Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed)."] + #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, +} +impl ComputeInstanceConnectivityEndpoints { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes information on user who created this ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceCreatedBy { + #[doc = "Name of the user."] + #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] + pub user_name: Option, + #[doc = "Uniquely identifies user' Azure Active Directory organization."] + #[serde(rename = "userOrgId", default, skip_serializing_if = "Option::is_none")] + pub user_org_id: Option, + #[doc = "Uniquely identifies the user within his/her organization."] + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option, +} +impl ComputeInstanceCreatedBy { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The last operation on ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceLastOperation { + #[doc = "Name of the last operation."] + #[serde(rename = "operationName", default, skip_serializing_if = "Option::is_none")] + pub operation_name: Option, + #[doc = "Time of the last operation."] + #[serde(rename = "operationTime", default, with = "azure_core::date::rfc3339::option")] + pub operation_time: Option, + #[doc = "Operation status."] + #[serde(rename = "operationStatus", default, skip_serializing_if = "Option::is_none")] + pub operation_status: Option, +} +impl ComputeInstanceLastOperation { + pub fn new() -> Self { + Self::default() + } +} +pub mod compute_instance_last_operation { + use super::*; + #[doc = "Name of the last operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OperationName")] + pub enum OperationName { + Create, + Start, + Stop, + Restart, + Reimage, + Delete, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OperationName { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OperationName { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OperationName { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Create => serializer.serialize_unit_variant("OperationName", 0u32, "Create"), + Self::Start => serializer.serialize_unit_variant("OperationName", 1u32, "Start"), + Self::Stop => serializer.serialize_unit_variant("OperationName", 2u32, "Stop"), + Self::Restart => serializer.serialize_unit_variant("OperationName", 3u32, "Restart"), + Self::Reimage => serializer.serialize_unit_variant("OperationName", 4u32, "Reimage"), + Self::Delete => serializer.serialize_unit_variant("OperationName", 5u32, "Delete"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Operation status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OperationStatus")] + pub enum OperationStatus { + InProgress, + Succeeded, + CreateFailed, + StartFailed, + StopFailed, + RestartFailed, + ReimageFailed, + DeleteFailed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OperationStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OperationStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OperationStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("OperationStatus", 0u32, "InProgress"), + Self::Succeeded => serializer.serialize_unit_variant("OperationStatus", 1u32, "Succeeded"), + Self::CreateFailed => serializer.serialize_unit_variant("OperationStatus", 2u32, "CreateFailed"), + Self::StartFailed => serializer.serialize_unit_variant("OperationStatus", 3u32, "StartFailed"), + Self::StopFailed => serializer.serialize_unit_variant("OperationStatus", 4u32, "StopFailed"), + Self::RestartFailed => serializer.serialize_unit_variant("OperationStatus", 5u32, "RestartFailed"), + Self::ReimageFailed => serializer.serialize_unit_variant("OperationStatus", 6u32, "ReimageFailed"), + Self::DeleteFailed => serializer.serialize_unit_variant("OperationStatus", 7u32, "DeleteFailed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Compute Instance properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceProperties { + #[doc = "Virtual Machine Size"] + #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] + pub vm_size: Option, + #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subnet: Option, + #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] + #[serde(rename = "applicationSharingPolicy", default, skip_serializing_if = "Option::is_none")] + pub application_sharing_policy: Option, + #[doc = "Specifies policy and settings for SSH access."] + #[serde(rename = "sshSettings", default, skip_serializing_if = "Option::is_none")] + pub ssh_settings: Option, + #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] + #[serde(rename = "connectivityEndpoints", default, skip_serializing_if = "Option::is_none")] + pub connectivity_endpoints: Option, + #[doc = "Describes available applications and their endpoints on this ComputeInstance."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub applications: Vec, + #[doc = "Describes information on user who created this ComputeInstance."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "Collection of errors encountered on this ComputeInstance."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, + #[doc = "Current state of an ComputeInstance."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] + #[serde(rename = "computeInstanceAuthorizationType", default, skip_serializing_if = "Option::is_none")] + pub compute_instance_authorization_type: Option, + #[doc = "Settings for a personal compute instance."] + #[serde(rename = "personalComputeInstanceSettings", default, skip_serializing_if = "Option::is_none")] + pub personal_compute_instance_settings: Option, + #[doc = "Details of customized scripts to execute for setting up the cluster."] + #[serde(rename = "setupScripts", default, skip_serializing_if = "Option::is_none")] + pub setup_scripts: Option, + #[doc = "The last operation on ComputeInstance."] + #[serde(rename = "lastOperation", default, skip_serializing_if = "Option::is_none")] + pub last_operation: Option, +} +impl ComputeInstanceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod compute_instance_properties { + use super::*; + #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ApplicationSharingPolicy")] + pub enum ApplicationSharingPolicy { + Personal, + Shared, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ApplicationSharingPolicy { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ApplicationSharingPolicy { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ApplicationSharingPolicy { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Personal => serializer.serialize_unit_variant("ApplicationSharingPolicy", 0u32, "Personal"), + Self::Shared => serializer.serialize_unit_variant("ApplicationSharingPolicy", 1u32, "Shared"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ApplicationSharingPolicy { + fn default() -> Self { + Self::Shared + } + } + #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ComputeInstanceAuthorizationType")] + pub enum ComputeInstanceAuthorizationType { + #[serde(rename = "personal")] + Personal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ComputeInstanceAuthorizationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ComputeInstanceAuthorizationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ComputeInstanceAuthorizationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Personal => serializer.serialize_unit_variant("ComputeInstanceAuthorizationType", 0u32, "personal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ComputeInstanceAuthorizationType { + fn default() -> Self { + Self::Personal + } + } +} +#[doc = "Specifies policy and settings for SSH access."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeInstanceSshSettings { + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] + #[serde(rename = "sshPublicAccess", default, skip_serializing_if = "Option::is_none")] + pub ssh_public_access: Option, + #[doc = "Describes the admin user name."] + #[serde(rename = "adminUserName", default, skip_serializing_if = "Option::is_none")] + pub admin_user_name: Option, + #[doc = "Describes the port for connecting through SSH."] + #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] + pub ssh_port: Option, + #[doc = "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs."] + #[serde(rename = "adminPublicKey", default, skip_serializing_if = "Option::is_none")] + pub admin_public_key: Option, +} +impl ComputeInstanceSshSettings { + pub fn new() -> Self { + Self::default() + } +} +pub mod compute_instance_ssh_settings { + use super::*; + #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SshPublicAccess")] + pub enum SshPublicAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SshPublicAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SshPublicAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SshPublicAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("SshPublicAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("SshPublicAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for SshPublicAccess { + fn default() -> Self { + Self::Disabled + } + } +} +#[doc = "Current state of an ComputeInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ComputeInstanceState")] +pub enum ComputeInstanceState { + Creating, + CreateFailed, + Deleting, + Running, + Restarting, + JobRunning, + SettingUp, + SetupFailed, + Starting, + Stopped, + Stopping, + UserSettingUp, + UserSetupFailed, + Unknown, + Unusable, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ComputeInstanceState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ComputeInstanceState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ComputeInstanceState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ComputeInstanceState", 0u32, "Creating"), + Self::CreateFailed => serializer.serialize_unit_variant("ComputeInstanceState", 1u32, "CreateFailed"), + Self::Deleting => serializer.serialize_unit_variant("ComputeInstanceState", 2u32, "Deleting"), + Self::Running => serializer.serialize_unit_variant("ComputeInstanceState", 3u32, "Running"), + Self::Restarting => serializer.serialize_unit_variant("ComputeInstanceState", 4u32, "Restarting"), + Self::JobRunning => serializer.serialize_unit_variant("ComputeInstanceState", 5u32, "JobRunning"), + Self::SettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 6u32, "SettingUp"), + Self::SetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 7u32, "SetupFailed"), + Self::Starting => serializer.serialize_unit_variant("ComputeInstanceState", 8u32, "Starting"), + Self::Stopped => serializer.serialize_unit_variant("ComputeInstanceState", 9u32, "Stopped"), + Self::Stopping => serializer.serialize_unit_variant("ComputeInstanceState", 10u32, "Stopping"), + Self::UserSettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 11u32, "UserSettingUp"), + Self::UserSetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 12u32, "UserSetupFailed"), + Self::Unknown => serializer.serialize_unit_variant("ComputeInstanceState", 13u32, "Unknown"), + Self::Unusable => serializer.serialize_unit_variant("ComputeInstanceState", 14u32, "Unusable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Machine Learning compute object wrapped into ARM resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Machine Learning compute object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Specifies the location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Contains resource tags defined as key/value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Sku of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl ComputeResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Secrets related to a Machine Learning compute. Might differ for every type of compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ComputeSecrets { + #[doc = "The type of compute"] + #[serde(rename = "computeType")] + pub compute_type: ComputeType, +} +impl ComputeSecrets { + pub fn new(compute_type: ComputeType) -> Self { + Self { compute_type } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "computeType")] +pub enum ComputeSecretsUnion { + #[serde(rename = "AKS")] + Aks(AksComputeSecrets), + Databricks(DatabricksComputeSecrets), + VirtualMachine(VirtualMachineSecrets), +} +#[doc = "The type of compute"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ComputeType")] +pub enum ComputeType { + #[serde(rename = "AKS")] + Aks, + Kubernetes, + AmlCompute, + ComputeInstance, + DataFactory, + VirtualMachine, + #[serde(rename = "HDInsight")] + HdInsight, + Databricks, + DataLakeAnalytics, + SynapseSpark, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ComputeType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ComputeType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ComputeType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aks => serializer.serialize_unit_variant("ComputeType", 0u32, "AKS"), + Self::Kubernetes => serializer.serialize_unit_variant("ComputeType", 1u32, "Kubernetes"), + Self::AmlCompute => serializer.serialize_unit_variant("ComputeType", 2u32, "AmlCompute"), + Self::ComputeInstance => serializer.serialize_unit_variant("ComputeType", 3u32, "ComputeInstance"), + Self::DataFactory => serializer.serialize_unit_variant("ComputeType", 4u32, "DataFactory"), + Self::VirtualMachine => serializer.serialize_unit_variant("ComputeType", 5u32, "VirtualMachine"), + Self::HdInsight => serializer.serialize_unit_variant("ComputeType", 6u32, "HDInsight"), + Self::Databricks => serializer.serialize_unit_variant("ComputeType", 7u32, "Databricks"), + Self::DataLakeAnalytics => serializer.serialize_unit_variant("ComputeType", 8u32, "DataLakeAnalytics"), + Self::SynapseSpark => serializer.serialize_unit_variant("ComputeType", 9u32, "SynapseSpark"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The resource requirements for the container (cpu and memory)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ContainerResourceRequirements { + #[doc = "The minimum amount of CPU cores to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cpu: Option, + #[doc = "The maximum amount of CPU cores allowed to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(rename = "cpuLimit", default, skip_serializing_if = "Option::is_none")] + pub cpu_limit: Option, + #[doc = "The minimum amount of memory (in GB) to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(rename = "memoryInGB", default, skip_serializing_if = "Option::is_none")] + pub memory_in_gb: Option, + #[doc = "The maximum amount of memory (in GB) allowed to be used by the container. More info:\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] + #[serde(rename = "memoryInGBLimit", default, skip_serializing_if = "Option::is_none")] + pub memory_in_gb_limit: Option, + #[doc = "The number of GPU cores in the container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gpu: Option, + #[doc = "The number of FPGA PCIE devices exposed to the container. Must be multiple of 2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fpga: Option, +} +impl ContainerResourceRequirements { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CosmosDbSettings { + #[doc = "The throughput of the collections in cosmosdb database"] + #[serde(rename = "collectionsThroughput", default, skip_serializing_if = "Option::is_none")] + pub collections_throughput: Option, +} +impl CosmosDbSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A DataFactory compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataFactory { + #[serde(flatten)] + pub compute: Compute, +} +impl DataFactory { + pub fn new(compute: Compute) -> Self { + Self { compute } + } +} +#[doc = "A DataLakeAnalytics compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataLakeAnalytics { + #[serde(flatten)] + pub compute: Compute, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DataLakeAnalytics { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod data_lake_analytics { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "DataLake Store Account Name"] + #[serde(rename = "dataLakeStoreAccountName", default, skip_serializing_if = "Option::is_none")] + pub data_lake_store_account_name: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "A DataFactory compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Databricks { + #[serde(flatten)] + pub compute: Compute, + #[doc = "Properties of Databricks"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Databricks { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +#[doc = "Secrets related to a Machine Learning compute based on Databricks."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DatabricksComputeSecrets { + #[serde(flatten)] + pub compute_secrets: ComputeSecrets, + #[serde(flatten)] + pub databricks_compute_secrets_properties: DatabricksComputeSecretsProperties, +} +impl DatabricksComputeSecrets { + pub fn new(compute_secrets: ComputeSecrets) -> Self { + Self { + compute_secrets, + databricks_compute_secrets_properties: DatabricksComputeSecretsProperties::default(), + } + } +} +#[doc = "Properties of Databricks Compute Secrets"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DatabricksComputeSecretsProperties { + #[doc = "access token for databricks account."] + #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] + pub databricks_access_token: Option, +} +impl DatabricksComputeSecretsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of Databricks"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DatabricksProperties { + #[doc = "Databricks access token"] + #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] + pub databricks_access_token: Option, + #[doc = "Workspace Url"] + #[serde(rename = "workspaceUrl", default, skip_serializing_if = "Option::is_none")] + pub workspace_url: Option, +} +impl DatabricksProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiagnoseRequestProperties { + #[doc = "Setting for diagnosing user defined routing"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub udr: Option, + #[doc = "Setting for diagnosing network security group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nsg: Option, + #[doc = "Setting for diagnosing resource lock"] + #[serde(rename = "resourceLock", default, skip_serializing_if = "Option::is_none")] + pub resource_lock: Option, + #[doc = "Setting for diagnosing dns resolution"] + #[serde(rename = "dnsResolution", default, skip_serializing_if = "Option::is_none")] + pub dns_resolution: Option, + #[doc = "Setting for diagnosing dependent storage account"] + #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] + pub storage_account: Option, + #[doc = "Setting for diagnosing dependent key vault"] + #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] + pub key_vault: Option, + #[doc = "Setting for diagnosing dependent container registry"] + #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] + pub container_registry: Option, + #[doc = "Setting for diagnosing dependent application insights"] + #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] + pub application_insights: Option, + #[doc = "Setting for diagnosing unclassified category of problems"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub others: Option, +} +impl DiagnoseRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiagnoseResponseResult { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl DiagnoseResponseResult { + pub fn new() -> Self { + Self::default() + } +} +pub mod diagnose_response_result { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Value { + #[serde( + rename = "userDefinedRouteResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub user_defined_route_results: Vec, + #[serde( + rename = "networkSecurityRuleResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_security_rule_results: Vec, + #[serde( + rename = "resourceLockResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resource_lock_results: Vec, + #[serde( + rename = "dnsResolutionResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dns_resolution_results: Vec, + #[serde( + rename = "storageAccountResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub storage_account_results: Vec, + #[serde( + rename = "keyVaultResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub key_vault_results: Vec, + #[serde( + rename = "containerRegistryResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub container_registry_results: Vec, + #[serde( + rename = "applicationInsightsResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub application_insights_results: Vec, + #[serde( + rename = "otherResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub other_results: Vec, + } + impl Value { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Result of Diagnose"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiagnoseResult { + #[doc = "Code for workspace setup error"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Level of workspace setup error"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level: Option, + #[doc = "Message of workspace setup error"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl DiagnoseResult { + pub fn new() -> Self { + Self::default() + } +} +pub mod diagnose_result { + use super::*; + #[doc = "Level of workspace setup error"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Level")] + pub enum Level { + Warning, + Error, + Information, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Level { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Level { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Level { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Warning => serializer.serialize_unit_variant("Level", 0u32, "Warning"), + Self::Error => serializer.serialize_unit_variant("Level", 1u32, "Error"), + Self::Information => serializer.serialize_unit_variant("Level", 2u32, "Information"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Parameters to diagnose a workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiagnoseWorkspaceParameters { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl DiagnoseWorkspaceParameters { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EncryptionProperty { + #[doc = "Indicates whether or not the encryption is enabled for the workspace."] + pub status: encryption_property::Status, + #[doc = "Identity that will be used to access key vault for encryption at rest"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[serde(rename = "keyVaultProperties")] + pub key_vault_properties: KeyVaultProperties, +} +impl EncryptionProperty { + pub fn new(status: encryption_property::Status, key_vault_properties: KeyVaultProperties) -> Self { + Self { + status, + identity: None, + key_vault_properties, + } + } +} +pub mod encryption_property { + use super::*; + #[doc = "Indicates whether or not the encryption is enabled for the workspace."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Status", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("Status", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The estimated price info for using a VM of a particular OS type, tier, etc."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EstimatedVmPrice { + #[doc = "The price charged for using the VM."] + #[serde(rename = "retailPrice")] + pub retail_price: f64, + #[doc = "Operating system type used by the VM."] + #[serde(rename = "osType")] + pub os_type: estimated_vm_price::OsType, + #[doc = "The type of the VM."] + #[serde(rename = "vmTier")] + pub vm_tier: estimated_vm_price::VmTier, +} +impl EstimatedVmPrice { + pub fn new(retail_price: f64, os_type: estimated_vm_price::OsType, vm_tier: estimated_vm_price::VmTier) -> Self { + Self { + retail_price, + os_type, + vm_tier, + } + } +} +pub mod estimated_vm_price { + use super::*; + #[doc = "Operating system type used by the VM."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OsType")] + pub enum OsType { + Linux, + Windows, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OsType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OsType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OsType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), + Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of the VM."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "VmTier")] + pub enum VmTier { + Standard, + LowPriority, + Spot, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for VmTier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for VmTier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for VmTier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Standard => serializer.serialize_unit_variant("VmTier", 0u32, "Standard"), + Self::LowPriority => serializer.serialize_unit_variant("VmTier", 1u32, "LowPriority"), + Self::Spot => serializer.serialize_unit_variant("VmTier", 2u32, "Spot"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The estimated price info for using a VM."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EstimatedVmPrices { + #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] + #[serde(rename = "billingCurrency")] + pub billing_currency: estimated_vm_prices::BillingCurrency, + #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] + #[serde(rename = "unitOfMeasure")] + pub unit_of_measure: estimated_vm_prices::UnitOfMeasure, + #[doc = "The list of estimated prices for using a VM of a particular OS type, tier, etc."] + pub values: Vec, +} +impl EstimatedVmPrices { + pub fn new( + billing_currency: estimated_vm_prices::BillingCurrency, + unit_of_measure: estimated_vm_prices::UnitOfMeasure, + values: Vec, + ) -> Self { + Self { + billing_currency, + unit_of_measure, + values, + } + } +} +pub mod estimated_vm_prices { + use super::*; + #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "BillingCurrency")] + pub enum BillingCurrency { + #[serde(rename = "USD")] + Usd, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for BillingCurrency { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for BillingCurrency { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for BillingCurrency { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Usd => serializer.serialize_unit_variant("BillingCurrency", 0u32, "USD"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "UnitOfMeasure")] + pub enum UnitOfMeasure { + OneHour, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for UnitOfMeasure { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for UnitOfMeasure { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for UnitOfMeasure { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::OneHour => serializer.serialize_unit_variant("UnitOfMeasure", 0u32, "OneHour"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalFqdnResponse { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl ExternalFqdnResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FqdnEndpoint { + #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] + pub domain_name: Option, + #[serde( + rename = "endpointDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoint_details: Vec, +} +impl FqdnEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FqdnEndpointDetail { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, +} +impl FqdnEndpointDetail { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FqdnEndpoints { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl FqdnEndpoints { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FqdnEndpointsProperties { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoints: Vec, +} +impl FqdnEndpointsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A HDInsight compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HdInsight { + #[serde(flatten)] + pub compute: Compute, + #[doc = "HDInsight compute properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl HdInsight { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +#[doc = "HDInsight compute properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HdInsightProperties { + #[doc = "Port open for ssh connections on the master node of the cluster."] + #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] + pub ssh_port: Option, + #[doc = "Public IP address of the master node of the cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[doc = "Admin credentials for virtual machine"] + #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] + pub administrator_account: Option, +} +impl HdInsightProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Identity for the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Identity { + #[doc = "The principal ID of resource identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of resource."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The identity type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "dictionary containing all the user assigned identities, with resourceId of the UAI as key."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl Identity { + pub fn new() -> Self { + Self::default() + } +} +pub mod identity { + use super::*; + #[doc = "The identity type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + SystemAssigned, + #[serde(rename = "SystemAssigned,UserAssigned")] + SystemAssignedUserAssigned, + UserAssigned, + None, + } +} +#[doc = "Identity that will be used to access key vault for encryption at rest"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IdentityForCmk { + #[doc = "The ArmId of the user assigned identity that will be used to access the customer managed key vault"] + #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identity: Option, +} +impl IdentityForCmk { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Resource requests/limits for this instance type"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InstanceResourceSchema {} +impl InstanceResourceSchema { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Instance type schema."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InstanceTypeSchema { + #[doc = "Node Selector"] + #[serde(rename = "nodeSelector", default, skip_serializing_if = "Option::is_none")] + pub node_selector: Option, + #[doc = "Resource requests/limits for this instance type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option, +} +impl InstanceTypeSchema { + pub fn new() -> Self { + Self::default() + } +} +pub mod instance_type_schema { + use super::*; + #[doc = "Resource requests/limits for this instance type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Resources { + #[doc = "Resource requests/limits for this instance type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub requests: Option, + #[doc = "Resource requests/limits for this instance type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limits: Option, + } + impl Resources { + pub fn new() -> Self { + Self::default() + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct KeyVaultProperties { + #[doc = "The ArmId of the keyVault where the customer owned encryption key is present."] + #[serde(rename = "keyVaultArmId")] + pub key_vault_arm_id: String, + #[doc = "Key vault uri to access the encryption key."] + #[serde(rename = "keyIdentifier")] + pub key_identifier: String, + #[doc = "For future use - The client id of the identity which will be used to access key vault."] + #[serde(rename = "identityClientId", default, skip_serializing_if = "Option::is_none")] + pub identity_client_id: Option, +} +impl KeyVaultProperties { + pub fn new(key_vault_arm_id: String, key_identifier: String) -> Self { + Self { + key_vault_arm_id, + key_identifier, + identity_client_id: None, + } + } +} +#[doc = "A Machine Learning compute based on Kubernetes Compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Kubernetes { + #[serde(flatten)] + pub compute: Compute, + #[serde(flatten)] + pub kubernetes_schema: KubernetesSchema, +} +impl Kubernetes { + pub fn new(compute: Compute) -> Self { + Self { + compute, + kubernetes_schema: KubernetesSchema::default(), + } + } +} +#[doc = "Kubernetes properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct KubernetesProperties { + #[doc = "Relay connection string."] + #[serde(rename = "relayConnectionString", default, skip_serializing_if = "Option::is_none")] + pub relay_connection_string: Option, + #[doc = "ServiceBus connection string."] + #[serde(rename = "serviceBusConnectionString", default, skip_serializing_if = "Option::is_none")] + pub service_bus_connection_string: Option, + #[doc = "Extension principal-id."] + #[serde(rename = "extensionPrincipalId", default, skip_serializing_if = "Option::is_none")] + pub extension_principal_id: Option, + #[doc = "Extension instance release train."] + #[serde(rename = "extensionInstanceReleaseTrain", default, skip_serializing_if = "Option::is_none")] + pub extension_instance_release_train: Option, + #[doc = "VC name."] + #[serde(rename = "vcName", default, skip_serializing_if = "Option::is_none")] + pub vc_name: Option, + #[doc = "Compute namespace"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option, + #[doc = "Default instance type"] + #[serde(rename = "defaultInstanceType", default, skip_serializing_if = "Option::is_none")] + pub default_instance_type: Option, + #[doc = "Instance Type Schema"] + #[serde(rename = "instanceTypes", default, skip_serializing_if = "Option::is_none")] + pub instance_types: Option, +} +impl KubernetesProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Kubernetes Compute Schema"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct KubernetesSchema { + #[doc = "Kubernetes properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl KubernetesSchema { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List Aml user feature operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListAmlUserFeatureResult { + #[doc = "The list of AML user facing features."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ListAmlUserFeatureResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ListAmlUserFeatureResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListNotebookKeysResult { + #[serde(rename = "primaryAccessKey", default, skip_serializing_if = "Option::is_none")] + pub primary_access_key: Option, + #[serde(rename = "secondaryAccessKey", default, skip_serializing_if = "Option::is_none")] + pub secondary_access_key: Option, +} +impl ListNotebookKeysResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListStorageAccountKeysResult { + #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] + pub user_storage_key: Option, +} +impl ListStorageAccountKeysResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List Usages operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListUsagesResult { + #[doc = "The list of AML resource usages."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ListUsagesResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ListUsagesResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListWorkspaceKeysResult { + #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] + pub user_storage_key: Option, + #[serde(rename = "userStorageResourceId", default, skip_serializing_if = "Option::is_none")] + pub user_storage_resource_id: Option, + #[serde(rename = "appInsightsInstrumentationKey", default, skip_serializing_if = "Option::is_none")] + pub app_insights_instrumentation_key: Option, + #[serde(rename = "containerRegistryCredentials", default, skip_serializing_if = "Option::is_none")] + pub container_registry_credentials: Option, + #[serde(rename = "notebookAccessKeys", default, skip_serializing_if = "Option::is_none")] + pub notebook_access_keys: Option, +} +impl ListWorkspaceKeysResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List WorkspaceQuotasByVMFamily operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListWorkspaceQuotas { + #[doc = "The list of Workspace Quotas by VM Family"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ListWorkspaceQuotas { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ListWorkspaceQuotas { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Counts of various compute node states on the amlCompute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NodeStateCounts { + #[doc = "Number of compute nodes in idle state."] + #[serde(rename = "idleNodeCount", default, skip_serializing_if = "Option::is_none")] + pub idle_node_count: Option, + #[doc = "Number of compute nodes which are running jobs."] + #[serde(rename = "runningNodeCount", default, skip_serializing_if = "Option::is_none")] + pub running_node_count: Option, + #[doc = "Number of compute nodes which are being prepared."] + #[serde(rename = "preparingNodeCount", default, skip_serializing_if = "Option::is_none")] + pub preparing_node_count: Option, + #[doc = "Number of compute nodes which are in unusable state."] + #[serde(rename = "unusableNodeCount", default, skip_serializing_if = "Option::is_none")] + pub unusable_node_count: Option, + #[doc = "Number of compute nodes which are leaving the amlCompute."] + #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] + pub leaving_node_count: Option, + #[doc = "Number of compute nodes which are in preempted state."] + #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] + pub preempted_node_count: Option, +} +impl NodeStateCounts { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NotebookAccessTokenResult { + #[serde(rename = "notebookResourceId", default, skip_serializing_if = "Option::is_none")] + pub notebook_resource_id: Option, + #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] + pub host_name: Option, + #[serde(rename = "publicDns", default, skip_serializing_if = "Option::is_none")] + pub public_dns: Option, + #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] + pub access_token: Option, + #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] + pub token_type: Option, + #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] + pub expires_in: Option, + #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option, +} +impl NotebookAccessTokenResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NotebookPreparationError { + #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "statusCode", default, skip_serializing_if = "Option::is_none")] + pub status_code: Option, +} +impl NotebookPreparationError { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NotebookResourceInfo { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fqdn: Option, + #[doc = "the data plane resourceId that used to initialize notebook component"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[serde(rename = "notebookPreparationError", default, skip_serializing_if = "Option::is_none")] + pub notebook_preparation_error: Option, +} +impl NotebookResourceInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Azure Machine Learning workspace REST API operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "Operation name: {provider}/{resource}/{operation}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Display name of operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Display name of operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The resource provider name: Microsoft.MachineLearningExperimentation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The resource on which the operation is performed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The operation that users can perform."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The description for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "An array of operations supported by the resource provider."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of AML workspace operations supported by the AML workspace resource provider."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paginated list of Machine Learning compute objects wrapped in ARM resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PaginatedComputeResourcesList { + #[doc = "An array of Machine Learning compute objects wrapped in ARM resource envelope."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A continuation link (absolute URI) to the next page of results in the list."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PaginatedComputeResourcesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl PaginatedComputeResourcesList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paginated list of Workspace connection objects."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PaginatedWorkspaceConnectionsList { + #[doc = "An array of Workspace connection objects."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A continuation link (absolute URI) to the next page of results in the list."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PaginatedWorkspaceConnectionsList { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl PaginatedWorkspaceConnectionsList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Password { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl Password { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Settings for a personal compute instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PersonalComputeInstanceSettings { + #[doc = "A user that can be assigned to a compute instance."] + #[serde(rename = "assignedUser", default, skip_serializing_if = "Option::is_none")] + pub assigned_user: Option, +} +impl PersonalComputeInstanceSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Private Endpoint resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpoint { + #[doc = "The ARM identifier for Private Endpoint"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The ARM identifier for Subnet resource that private endpoint links to"] + #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] + pub subnet_arm_id: Option, +} +impl PrivateEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Private Endpoint Connection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnection { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the PrivateEndpointConnectProperties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Specifies the location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Contains resource tags defined as key/value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Sku of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PrivateEndpointConnection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of private endpoint connection associated with the specified workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnectionListResult { + #[doc = "Array of private endpoint connections"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for PrivateEndpointConnectionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl PrivateEndpointConnectionListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the PrivateEndpointConnectProperties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnectionProperties { + #[doc = "The Private Endpoint resource."] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "A collection of information about the state of the connection between service consumer and provider."] + #[serde(rename = "privateLinkServiceConnectionState")] + pub private_link_service_connection_state: PrivateLinkServiceConnectionState, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PrivateEndpointConnectionProperties { + pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { + Self { + private_endpoint: None, + private_link_service_connection_state, + provisioning_state: None, + } + } +} +#[doc = "The current provisioning state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PrivateEndpointConnectionProvisioningState")] +pub enum PrivateEndpointConnectionProvisioningState { + Succeeded, + Creating, + Deleting, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PrivateEndpointConnectionProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PrivateEndpointConnectionProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), + Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"), + Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The private endpoint connection status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PrivateEndpointServiceConnectionStatus")] +pub enum PrivateEndpointServiceConnectionStatus { + Pending, + Approved, + Rejected, + Disconnected, + Timeout, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PrivateEndpointServiceConnectionStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PrivateEndpointServiceConnectionStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Pending"), + Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Approved"), + Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"), + Self::Disconnected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 3u32, "Disconnected"), + Self::Timeout => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 4u32, "Timeout"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A private link resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of a private link resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Specifies the location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Contains resource tags defined as key/value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Sku of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PrivateLinkResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of private link resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceListResult { + #[doc = "Array of private link resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl PrivateLinkResourceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a private link resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceProperties { + #[doc = "The private link resource group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "The private link resource required member names."] + #[serde( + rename = "requiredMembers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_members: Vec, + #[doc = "The private link resource Private link DNS zone name."] + #[serde( + rename = "requiredZoneNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_zone_names: Vec, +} +impl PrivateLinkResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A collection of information about the state of the connection between service consumer and provider."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkServiceConnectionState { + #[doc = "The private endpoint connection status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The reason for approval/rejection of the connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "A message indicating if changes on the service provider require any updates on the consumer."] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, +} +impl PrivateLinkServiceConnectionState { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties for Quota update or retrieval."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QuotaBaseProperties { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The maximum permitted quota of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "An enum describing the unit of quota measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, +} +impl QuotaBaseProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod quota_base_properties { + use super::*; + #[doc = "An enum describing the unit of quota measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Quota update parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QuotaUpdateParameters { + #[doc = "The list for update quota."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Region of workspace quota to be updated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl QuotaUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegistryListCredentialsResult { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub passwords: Vec, +} +impl RegistryListCredentialsResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceId { + #[doc = "The ID of the resource"] + pub id: String, +} +impl ResourceId { + pub fn new(id: String) -> Self { + Self { id } + } +} +#[doc = "The Resource Name."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceName { + #[doc = "The name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The localized name of the resource."] + #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] + pub localized_value: Option, +} +impl ResourceName { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The quota assigned to a resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceQuota { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Region of the AML workspace in the id."] + #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] + pub aml_workspace_location: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The Resource Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The maximum permitted quota of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "An enum describing the unit of quota measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, +} +impl ResourceQuota { + pub fn new() -> Self { + Self::default() + } +} +pub mod resource_quota { + use super::*; + #[doc = "An enum describing the unit of quota measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceSkuLocationInfo { + #[doc = "Location of the SKU"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "List of availability zones where the SKU is supported."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub zones: Vec, + #[doc = "Details of capabilities available to a SKU in specific zones."] + #[serde( + rename = "zoneDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub zone_details: Vec, +} +impl ResourceSkuLocationInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes The zonal capabilities of a SKU."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceSkuZoneDetails { + #[doc = "The set of zones that the SKU is available in with the specified capabilities."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub name: Vec, + #[doc = "A list of capabilities that are available for the SKU in the specified list of zones."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub capabilities: Vec, +} +impl ResourceSkuZoneDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The restriction because of which SKU cannot be used."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Restriction { + #[doc = "The type of restrictions. As of now only possible value for this is location."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, + #[doc = "The reason for the restriction."] + #[serde(rename = "reasonCode", default, skip_serializing_if = "Option::is_none")] + pub reason_code: Option, +} +impl Restriction { + pub fn new() -> Self { + Self::default() + } +} +pub mod restriction { + use super::*; + #[doc = "The reason for the restriction."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReasonCode")] + pub enum ReasonCode { + NotSpecified, + NotAvailableForRegion, + NotAvailableForSubscription, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReasonCode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReasonCode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReasonCode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NotSpecified => serializer.serialize_unit_variant("ReasonCode", 0u32, "NotSpecified"), + Self::NotAvailableForRegion => serializer.serialize_unit_variant("ReasonCode", 1u32, "NotAvailableForRegion"), + Self::NotAvailableForSubscription => serializer.serialize_unit_variant("ReasonCode", 2u32, "NotAvailableForSubscription"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Features/user capabilities associated with the sku"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SkuCapability { + #[doc = "Capability/Feature ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Details about the feature/capability"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl SkuCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "scale settings for AML Compute"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScaleSettings { + #[doc = "Max number of nodes to use"] + #[serde(rename = "maxNodeCount")] + pub max_node_count: i32, + #[doc = "Min number of nodes to use"] + #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] + pub min_node_count: Option, + #[doc = "Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format."] + #[serde(rename = "nodeIdleTimeBeforeScaleDown", default, skip_serializing_if = "Option::is_none")] + pub node_idle_time_before_scale_down: Option, +} +impl ScaleSettings { + pub fn new(max_node_count: i32) -> Self { + Self { + max_node_count, + min_node_count: None, + node_idle_time_before_scale_down: None, + } + } +} +#[doc = "Desired scale settings for the amlCompute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScaleSettingsInformation { + #[doc = "scale settings for AML Compute"] + #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] + pub scale_settings: Option, +} +impl ScaleSettingsInformation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Script reference"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptReference { + #[doc = "The storage source of the script: inline, workspace."] + #[serde(rename = "scriptSource", default, skip_serializing_if = "Option::is_none")] + pub script_source: Option, + #[doc = "The location of scripts in the mounted volume."] + #[serde(rename = "scriptData", default, skip_serializing_if = "Option::is_none")] + pub script_data: Option, + #[doc = "Optional command line arguments passed to the script to run."] + #[serde(rename = "scriptArguments", default, skip_serializing_if = "Option::is_none")] + pub script_arguments: Option, + #[doc = "Optional time period passed to timeout command."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, +} +impl ScriptReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Customized setup scripts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptsToExecute { + #[doc = "Script reference"] + #[serde(rename = "startupScript", default, skip_serializing_if = "Option::is_none")] + pub startup_script: Option, + #[doc = "Script reference"] + #[serde(rename = "creationScript", default, skip_serializing_if = "Option::is_none")] + pub creation_script: Option, +} +impl ScriptsToExecute { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceManagedResourcesSettings { + #[serde(rename = "cosmosDb", default, skip_serializing_if = "Option::is_none")] + pub cosmos_db: Option, +} +impl ServiceManagedResourcesSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Service principal credentials."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServicePrincipalCredentials { + #[doc = "Client Id"] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "Client secret"] + #[serde(rename = "clientSecret")] + pub client_secret: String, +} +impl ServicePrincipalCredentials { + pub fn new(client_id: String, client_secret: String) -> Self { + Self { client_id, client_secret } + } +} +#[doc = "Details of customized scripts to execute for setting up the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SetupScripts { + #[doc = "Customized setup scripts"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scripts: Option, +} +impl SetupScripts { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SharedPrivateLinkResource { + #[doc = "Unique name of the private link."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Properties of a shared private link resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SharedPrivateLinkResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a shared private link resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SharedPrivateLinkResourceProperty { + #[doc = "The resource id that private link links to."] + #[serde(rename = "privateLinkResourceId", default, skip_serializing_if = "Option::is_none")] + pub private_link_resource_id: Option, + #[doc = "The private link resource group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "Request message."] + #[serde(rename = "requestMessage", default, skip_serializing_if = "Option::is_none")] + pub request_message: Option, + #[doc = "The private endpoint connection status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl SharedPrivateLinkResourceProperty { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Sku of the resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Sku { + #[doc = "Name of the sku"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Tier of the sku like Basic or Enterprise"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, +} +impl Sku { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of skus with features"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SkuListResult { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of Workspace Skus. Call ListNext() with this URI to fetch the next page of Workspace Skus"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SkuListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl SkuListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The ssl configuration for scoring"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SslConfiguration { + #[doc = "Enable or disable ssl for scoring"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Cert data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cert: Option, + #[doc = "Key data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + #[doc = "CNAME of the cert"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cname: Option, + #[doc = "Leaf domain label of public endpoint"] + #[serde(rename = "leafDomainLabel", default, skip_serializing_if = "Option::is_none")] + pub leaf_domain_label: Option, + #[doc = "Indicates whether to overwrite existing domain label."] + #[serde(rename = "overwriteExistingDomain", default, skip_serializing_if = "Option::is_none")] + pub overwrite_existing_domain: Option, +} +impl SslConfiguration { + pub fn new() -> Self { + Self::default() + } +} +pub mod ssl_configuration { + use super::*; + #[doc = "Enable or disable ssl for scoring"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + Disabled, + Enabled, + Auto, + } +} +#[doc = "A SynapseSpark compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SynapseSpark { + #[serde(flatten)] + pub compute: Compute, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SynapseSpark { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod synapse_spark { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Auto scale properties"] + #[serde(rename = "autoScaleProperties", default, skip_serializing_if = "Option::is_none")] + pub auto_scale_properties: Option, + #[doc = "Auto pause properties"] + #[serde(rename = "autoPauseProperties", default, skip_serializing_if = "Option::is_none")] + pub auto_pause_properties: Option, + #[doc = "Spark version."] + #[serde(rename = "sparkVersion", default, skip_serializing_if = "Option::is_none")] + pub spark_version: Option, + #[doc = "The number of compute nodes currently assigned to the compute."] + #[serde(rename = "nodeCount", default, skip_serializing_if = "Option::is_none")] + pub node_count: Option, + #[doc = "Node size."] + #[serde(rename = "nodeSize", default, skip_serializing_if = "Option::is_none")] + pub node_size: Option, + #[doc = "Node size family."] + #[serde(rename = "nodeSizeFamily", default, skip_serializing_if = "Option::is_none")] + pub node_size_family: Option, + #[doc = "Azure subscription identifier."] + #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] + pub subscription_id: Option, + #[doc = "Name of the resource group in which workspace is located."] + #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] + pub resource_group: Option, + #[doc = "Name of Azure Machine Learning workspace."] + #[serde(rename = "workspaceName", default, skip_serializing_if = "Option::is_none")] + pub workspace_name: Option, + #[doc = "Pool name."] + #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] + pub pool_name: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "A system service running on a compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemService { + #[doc = "The type of this system service."] + #[serde(rename = "systemServiceType", default, skip_serializing_if = "Option::is_none")] + pub system_service_type: Option, + #[doc = "Public IP address"] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, + #[doc = "The version for this type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl SystemService { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties for update Quota response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateWorkspaceQuotas { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The maximum permitted quota of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "An enum describing the unit of quota measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "Status of update workspace quota."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl UpdateWorkspaceQuotas { + pub fn new() -> Self { + Self::default() + } +} +pub mod update_workspace_quotas { + use super::*; + #[doc = "An enum describing the unit of quota measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Status of update workspace quota."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Undefined, + Success, + Failure, + InvalidQuotaBelowClusterMinimum, + InvalidQuotaExceedsSubscriptionLimit, + #[serde(rename = "InvalidVMFamilyName")] + InvalidVmFamilyName, + OperationNotSupportedForSku, + OperationNotEnabledForRegion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Undefined => serializer.serialize_unit_variant("Status", 0u32, "Undefined"), + Self::Success => serializer.serialize_unit_variant("Status", 1u32, "Success"), + Self::Failure => serializer.serialize_unit_variant("Status", 2u32, "Failure"), + Self::InvalidQuotaBelowClusterMinimum => { + serializer.serialize_unit_variant("Status", 3u32, "InvalidQuotaBelowClusterMinimum") + } + Self::InvalidQuotaExceedsSubscriptionLimit => { + serializer.serialize_unit_variant("Status", 4u32, "InvalidQuotaExceedsSubscriptionLimit") + } + Self::InvalidVmFamilyName => serializer.serialize_unit_variant("Status", 5u32, "InvalidVMFamilyName"), + Self::OperationNotSupportedForSku => serializer.serialize_unit_variant("Status", 6u32, "OperationNotSupportedForSku"), + Self::OperationNotEnabledForRegion => serializer.serialize_unit_variant("Status", 7u32, "OperationNotEnabledForRegion"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The result of update workspace quota."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateWorkspaceQuotasResult { + #[doc = "The list of workspace quota update result."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl UpdateWorkspaceQuotasResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes AML Resource Usage."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Usage { + #[doc = "Specifies the resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Region of the AML workspace in the id."] + #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] + pub aml_workspace_location: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "An enum describing the unit of usage measurement."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "The current usage of the resource."] + #[serde(rename = "currentValue", default, skip_serializing_if = "Option::is_none")] + pub current_value: Option, + #[doc = "The maximum permitted usage of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "The Usage Names."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl Usage { + pub fn new() -> Self { + Self::default() + } +} +pub mod usage { + use super::*; + #[doc = "An enum describing the unit of usage measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The Usage Names."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UsageName { + #[doc = "The name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The localized name of the resource."] + #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] + pub localized_value: Option, +} +impl UsageName { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Settings for user account that gets created on each on the nodes of a compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserAccountCredentials { + #[doc = "Name of the administrator user account which can be used to SSH to nodes."] + #[serde(rename = "adminUserName")] + pub admin_user_name: String, + #[doc = "SSH public key of the administrator user account."] + #[serde(rename = "adminUserSshPublicKey", default, skip_serializing_if = "Option::is_none")] + pub admin_user_ssh_public_key: Option, + #[doc = "Password of the administrator user account."] + #[serde(rename = "adminUserPassword", default, skip_serializing_if = "Option::is_none")] + pub admin_user_password: Option, +} +impl UserAccountCredentials { + pub fn new(admin_user_name: String) -> Self { + Self { + admin_user_name, + admin_user_ssh_public_key: None, + admin_user_password: None, + } + } +} +#[doc = "dictionary containing all the user assigned identities, with resourceId of the UAI as key."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User Assigned Identity"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the user assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of the user assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The clientId(aka appId) of the user assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A Machine Learning compute based on Azure Virtual Machines."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachine { + #[serde(flatten)] + pub compute: Compute, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl VirtualMachine { + pub fn new(compute: Compute) -> Self { + Self { compute, properties: None } + } +} +pub mod virtual_machine { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Virtual Machine size"] + #[serde(rename = "virtualMachineSize", default, skip_serializing_if = "Option::is_none")] + pub virtual_machine_size: Option, + #[doc = "Port open for ssh connections."] + #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] + pub ssh_port: Option, + #[doc = "Public IP address of the virtual machine."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[doc = "Admin credentials for virtual machine"] + #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] + pub administrator_account: Option, + #[doc = "Indicates whether this compute will be used for running notebooks."] + #[serde(rename = "isNotebookInstanceCompute", default, skip_serializing_if = "Option::is_none")] + pub is_notebook_instance_compute: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Virtual Machine image for Windows AML Compute"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachineImage { + #[doc = "Virtual Machine image path"] + pub id: String, +} +impl VirtualMachineImage { + pub fn new(id: String) -> Self { + Self { id } + } +} +#[doc = "Secrets related to a Machine Learning compute based on AKS."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachineSecrets { + #[serde(flatten)] + pub compute_secrets: ComputeSecrets, + #[doc = "Admin credentials for virtual machine"] + #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] + pub administrator_account: Option, +} +impl VirtualMachineSecrets { + pub fn new(compute_secrets: ComputeSecrets) -> Self { + Self { + compute_secrets, + administrator_account: None, + } + } +} +#[doc = "Describes the properties of a VM size."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineSize { + #[doc = "The name of the virtual machine size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The family name of the virtual machine size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family: Option, + #[doc = "The number of vCPUs supported by the virtual machine size."] + #[serde(rename = "vCPUs", default, skip_serializing_if = "Option::is_none")] + pub v_cp_us: Option, + #[doc = "The number of gPUs supported by the virtual machine size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gpus: Option, + #[doc = "The OS VHD disk size, in MB, allowed by the virtual machine size."] + #[serde(rename = "osVhdSizeMB", default, skip_serializing_if = "Option::is_none")] + pub os_vhd_size_mb: Option, + #[doc = "The resource volume size, in MB, allowed by the virtual machine size."] + #[serde(rename = "maxResourceVolumeMB", default, skip_serializing_if = "Option::is_none")] + pub max_resource_volume_mb: Option, + #[doc = "The amount of memory, in GB, supported by the virtual machine size."] + #[serde(rename = "memoryGB", default, skip_serializing_if = "Option::is_none")] + pub memory_gb: Option, + #[doc = "Specifies if the virtual machine size supports low priority VMs."] + #[serde(rename = "lowPriorityCapable", default, skip_serializing_if = "Option::is_none")] + pub low_priority_capable: Option, + #[doc = "Specifies if the virtual machine size supports premium IO."] + #[serde(rename = "premiumIO", default, skip_serializing_if = "Option::is_none")] + pub premium_io: Option, + #[doc = "The estimated price info for using a VM."] + #[serde(rename = "estimatedVMPrices", default, skip_serializing_if = "Option::is_none")] + pub estimated_vm_prices: Option, + #[doc = "Specifies the compute types supported by the virtual machine size."] + #[serde( + rename = "supportedComputeTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_compute_types: Vec, +} +impl VirtualMachineSize { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List Virtual Machine size operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineSizeListResult { + #[doc = "The list of virtual machine sizes supported by AmlCompute."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl VirtualMachineSizeListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Admin credentials for virtual machine"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineSshCredentials { + #[doc = "Username of admin account"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "Password of admin account"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, + #[doc = "Public key data"] + #[serde(rename = "publicKeyData", default, skip_serializing_if = "Option::is_none")] + pub public_key_data: Option, + #[doc = "Private key data"] + #[serde(rename = "privateKeyData", default, skip_serializing_if = "Option::is_none")] + pub private_key_data: Option, +} +impl VirtualMachineSshCredentials { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An object that represents a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Workspace { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The properties of a machine learning workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Specifies the location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Contains resource tags defined as key/value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Sku of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Workspace { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Workspace connection."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceConnection { + #[doc = "ResourceId of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Friendly name of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type of workspace connection."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Workspace Connection specific properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceConnection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Workspace Connection specific properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceConnectionProps { + #[doc = "Category of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "Target of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "Authorization type of the workspace connection."] + #[serde(rename = "authType", default, skip_serializing_if = "Option::is_none")] + pub auth_type: Option, + #[doc = "Value details of the workspace connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "format for the workspace connection value"] + #[serde(rename = "valueFormat", default, skip_serializing_if = "Option::is_none")] + pub value_format: Option, +} +impl WorkspaceConnectionProps { + pub fn new() -> Self { + Self::default() + } +} +pub mod workspace_connection_props { + use super::*; + #[doc = "format for the workspace connection value"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ValueFormat")] + pub enum ValueFormat { + #[serde(rename = "JSON")] + Json, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ValueFormat { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ValueFormat { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ValueFormat { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Json => serializer.serialize_unit_variant("ValueFormat", 0u32, "JSON"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The result of a request to list machine learning workspaces."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceListResult { + #[doc = "The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI that can be used to request the next list of machine learning workspaces."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl WorkspaceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceProperties { + #[doc = "The immutable id associated with this workspace."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The description of this workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The friendly name for this workspace. This name in mutable"] + #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] + pub key_vault: Option, + #[doc = "ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] + pub application_insights: Option, + #[doc = "ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] + pub container_registry: Option, + #[doc = "ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created"] + #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] + pub storage_account: Option, + #[doc = "Url for the discovery service to identify regional endpoints for machine learning experimentation services"] + #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] + pub discovery_url: Option, + #[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encryption: Option, + #[doc = "The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service"] + #[serde(rename = "hbiWorkspace", default, skip_serializing_if = "Option::is_none")] + pub hbi_workspace: Option, + #[doc = "The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace"] + #[serde(rename = "serviceProvisionedResourceGroup", default, skip_serializing_if = "Option::is_none")] + pub service_provisioned_resource_group: Option, + #[doc = "Count of private connections in the workspace"] + #[serde(rename = "privateLinkCount", default, skip_serializing_if = "Option::is_none")] + pub private_link_count: Option, + #[doc = "The compute name for image build"] + #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] + pub image_build_compute: Option, + #[doc = "The flag to indicate whether to allow public access when behind VNet."] + #[serde(rename = "allowPublicAccessWhenBehindVnet", default, skip_serializing_if = "Option::is_none")] + pub allow_public_access_when_behind_vnet: Option, + #[doc = "Whether requests from Public Network are allowed."] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "The list of private endpoint connections in the workspace."] + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "The list of shared private link resources in this workspace."] + #[serde( + rename = "sharedPrivateLinkResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub shared_private_link_resources: Vec, + #[serde(rename = "notebookInfo", default, skip_serializing_if = "Option::is_none")] + pub notebook_info: Option, + #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] + pub service_managed_resources_settings: Option, + #[doc = "The user assigned identity resource id that represents the workspace identity."] + #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub primary_user_assigned_identity: Option, + #[doc = "The tenant id associated with this workspace."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "If the storage associated with the workspace has hierarchical namespace(HNS) enabled."] + #[serde(rename = "storageHnsEnabled", default, skip_serializing_if = "Option::is_none")] + pub storage_hns_enabled: Option, + #[doc = "The URI associated with this workspace that machine learning flow must point at to set up tracking."] + #[serde(rename = "mlFlowTrackingUri", default, skip_serializing_if = "Option::is_none")] + pub ml_flow_tracking_uri: Option, +} +impl WorkspaceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod workspace_properties { + use super::*; + #[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Unknown, + Updating, + Creating, + Deleting, + Succeeded, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Whether requests from Public Network are allowed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The parameters for updating the properties of a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspacePropertiesUpdateParameters { + #[doc = "The description of this workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The friendly name for this workspace."] + #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The compute name for image build"] + #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] + pub image_build_compute: Option, + #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] + pub service_managed_resources_settings: Option, + #[doc = "The user assigned identity resource id that represents the workspace identity."] + #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub primary_user_assigned_identity: Option, + #[doc = "Whether requests from Public Network are allowed."] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, +} +impl WorkspacePropertiesUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +pub mod workspace_properties_update_parameters { + use super::*; + #[doc = "Whether requests from Public Network are allowed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes Workspace Sku details and features"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceSku { + #[doc = "The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.)."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub locations: Vec, + #[doc = "A list of locations and availability zones in those locations where the SKU is available."] + #[serde( + rename = "locationInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub location_info: Vec, + #[doc = "Sku Tier like Basic or Enterprise"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, + #[serde(rename = "resourceType", default, skip_serializing_if = "Option::is_none")] + pub resource_type: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "List of features/user capabilities associated with the sku"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub capabilities: Vec, + #[doc = "The restrictions because of which SKU cannot be used. This is empty if there are no restrictions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub restrictions: Vec, +} +impl WorkspaceSku { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The parameters for updating a machine learning workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceUpdateParameters { + #[doc = "The resource tags for the machine learning workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Sku of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "The parameters for updating the properties of a machine learning workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/machinelearningservices/src/package_preview_2023_02/mod.rs b/services/mgmt/machinelearningservices/src/package_2022_05_01/mod.rs similarity index 56% rename from services/mgmt/machinelearningservices/src/package_preview_2023_02/mod.rs rename to services/mgmt/machinelearningservices/src/package_2022_05_01/mod.rs index f0504dc9ef..316936cf97 100644 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_02/mod.rs +++ b/services/mgmt/machinelearningservices/src/package_2022_05_01/mod.rs @@ -139,24 +139,9 @@ impl Client { pub fn environment_versions_client(&self) -> environment_versions::Client { environment_versions::Client(self.clone()) } - pub fn featureset_containers_client(&self) -> featureset_containers::Client { - featureset_containers::Client(self.clone()) - } - pub fn featureset_versions_client(&self) -> featureset_versions::Client { - featureset_versions::Client(self.clone()) - } - pub fn featurestore_entity_containers_client(&self) -> featurestore_entity_containers::Client { - featurestore_entity_containers::Client(self.clone()) - } - pub fn featurestore_entity_versions_client(&self) -> featurestore_entity_versions::Client { - featurestore_entity_versions::Client(self.clone()) - } pub fn jobs_client(&self) -> jobs::Client { jobs::Client(self.clone()) } - pub fn labeling_jobs_client(&self) -> labeling_jobs::Client { - labeling_jobs::Client(self.clone()) - } pub fn model_containers_client(&self) -> model_containers::Client { model_containers::Client(self.clone()) } @@ -181,42 +166,6 @@ impl Client { pub fn quotas_client(&self) -> quotas::Client { quotas::Client(self.clone()) } - pub fn registries_client(&self) -> registries::Client { - registries::Client(self.clone()) - } - pub fn registry_code_containers_client(&self) -> registry_code_containers::Client { - registry_code_containers::Client(self.clone()) - } - pub fn registry_code_versions_client(&self) -> registry_code_versions::Client { - registry_code_versions::Client(self.clone()) - } - pub fn registry_component_containers_client(&self) -> registry_component_containers::Client { - registry_component_containers::Client(self.clone()) - } - pub fn registry_component_versions_client(&self) -> registry_component_versions::Client { - registry_component_versions::Client(self.clone()) - } - pub fn registry_data_containers_client(&self) -> registry_data_containers::Client { - registry_data_containers::Client(self.clone()) - } - pub fn registry_data_versions_client(&self) -> registry_data_versions::Client { - registry_data_versions::Client(self.clone()) - } - pub fn registry_environment_containers_client(&self) -> registry_environment_containers::Client { - registry_environment_containers::Client(self.clone()) - } - pub fn registry_environment_versions_client(&self) -> registry_environment_versions::Client { - registry_environment_versions::Client(self.clone()) - } - pub fn registry_model_containers_client(&self) -> registry_model_containers::Client { - registry_model_containers::Client(self.clone()) - } - pub fn registry_model_versions_client(&self) -> registry_model_versions::Client { - registry_model_versions::Client(self.clone()) - } - pub fn schedules_client(&self) -> schedules::Client { - schedules::Client(self.clone()) - } pub fn usages_client(&self) -> usages::Client { usages::Client(self.clone()) } @@ -241,7 +190,7 @@ pub mod operations { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all of the available Azure Machine Learning Services REST API operations."] + #[doc = "Lists all of the available Azure Machine Learning Workspaces REST API operations."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } @@ -332,7 +281,7 @@ pub mod operations { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -427,7 +376,6 @@ pub mod workspaces { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - force_to_purge: None, } } #[doc = "Lists all the available machine learning workspaces under the specified resource group."] @@ -445,7 +393,6 @@ pub mod workspaces { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), skip: None, - kind: None, } } #[doc = "Diagnose workspace setup issue."] @@ -515,7 +462,6 @@ pub mod workspaces { client: self.0.clone(), subscription_id: subscription_id.into(), skip: None, - kind: None, } } #[doc = "return notebook access token and refresh token"] @@ -704,7 +650,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -813,7 +759,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -950,7 +896,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1045,14 +991,8 @@ pub mod workspaces { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) force_to_purge: Option, } impl RequestBuilder { - #[doc = "Flag to indicate delete is a purge request."] - pub fn force_to_purge(mut self, force_to_purge: bool) -> Self { - self.force_to_purge = Some(force_to_purge); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1069,11 +1009,6 @@ pub mod workspaces { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(force_to_purge) = &this.force_to_purge { - req.url_mut() - .query_pairs_mut() - .append_pair("forceToPurge", &force_to_purge.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1091,7 +1026,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1152,7 +1087,6 @@ pub mod workspaces { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) skip: Option, - pub(crate) kind: Option, } impl RequestBuilder { #[doc = "Continuation token for pagination."] @@ -1160,11 +1094,6 @@ pub mod workspaces { self.skip = Some(skip.into()); self } - #[doc = "Kind of workspace."] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); - self - } pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); @@ -1186,7 +1115,7 @@ pub mod workspaces { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1203,9 +1132,6 @@ pub mod workspaces { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1233,7 +1159,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1348,7 +1274,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1445,7 +1371,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1548,7 +1474,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1608,7 +1534,6 @@ pub mod workspaces { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) skip: Option, - pub(crate) kind: Option, } impl RequestBuilder { #[doc = "Continuation token for pagination."] @@ -1616,11 +1541,6 @@ pub mod workspaces { self.skip = Some(skip.into()); self } - #[doc = "Kind of workspace."] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); - self - } pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); @@ -1642,7 +1562,7 @@ pub mod workspaces { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1659,9 +1579,6 @@ pub mod workspaces { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1688,7 +1605,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1779,7 +1696,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -1887,7 +1804,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2053,7 +1970,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2162,7 +2079,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2264,7 +2181,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2381,7 +2298,7 @@ pub mod usages { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2422,7 +2339,7 @@ pub mod usages { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2538,7 +2455,7 @@ pub mod virtual_machine_sizes { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2687,7 +2604,7 @@ pub mod quotas { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2782,7 +2699,7 @@ pub mod quotas { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2823,7 +2740,7 @@ pub mod quotas { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -2955,31 +2872,6 @@ pub mod compute { underlying_resource_action: underlying_resource_action.into(), } } - #[doc = "Updates the custom services list. The list of custom services provided shall be overwritten"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `custom_services`: New list of Custom Services."] - pub fn update_custom_services( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - custom_services: Vec, - ) -> update_custom_services::RequestBuilder { - update_custom_services::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - custom_services, - } - } #[doc = "Get the details (e.g IP address, port etc) of all the compute nodes in the compute."] #[doc = ""] #[doc = "Arguments:"] @@ -3090,31 +2982,6 @@ pub mod compute { compute_name: compute_name.into(), } } - #[doc = "Updates the idle shutdown setting of a compute instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: The object for updating idle shutdown setting of specified ComputeInstance."] - pub fn update_idle_shutdown_setting( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> update_idle_shutdown_setting::RequestBuilder { - update_idle_shutdown_setting::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } } pub mod list { use super::models; @@ -3200,7 +3067,7 @@ pub mod compute { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3245,7 +3112,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -3343,7 +3210,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -3465,7 +3332,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -3604,7 +3471,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -3756,95 +3623,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod update_custom_services { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) custom_services: Vec, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.custom_services)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/customServices" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -3929,7 +3708,7 @@ pub mod compute { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3973,7 +3752,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4072,7 +3851,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4177,7 +3956,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4270,7 +4049,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4363,95 +4142,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod update_idle_shutdown_setting { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::IdleShutdownSetting, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/updateIdleShutdownSetting" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4641,7 +4332,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4732,7 +4423,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4837,7 +4528,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -4935,7 +4626,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -5060,7 +4751,7 @@ pub mod private_link_resources { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -5262,7 +4953,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -5374,7 +5065,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -5479,7 +5170,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -5578,7 +5269,7 @@ pub mod workspace_connections { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5626,14 +5317,14 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } } -pub mod registry_code_containers { +pub mod batch_endpoints { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -5641,93 +5332,141 @@ pub mod registry_code_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List containers."] + #[doc = "Lists Batch inference endpoint in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + count: None, skip: None, } } - #[doc = "Get container."] + #[doc = "Gets a batch inference endpoint by name."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates a batch inference endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] + #[doc = "* `body`: Batch inference endpoint definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Update a batch inference endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] + #[doc = "* `body`: Mutable batch inference endpoint definition object."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), + } + } + #[doc = "Delete Batch Inference Endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference Endpoint name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } + } + #[doc = "Lists batch Inference Endpoint keys."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference Endpoint name."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), } } } @@ -5740,9 +5479,9 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5785,16 +5524,24 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) count: Option, pub(crate) skip: Option, } impl RequestBuilder { + #[doc = "Number of endpoints to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -5815,7 +5562,7 @@ pub mod registry_code_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5829,6 +5576,9 @@ pub mod registry_code_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -5851,16 +5601,16 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -5875,9 +5625,9 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5920,8 +5670,8 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5948,24 +5698,24 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5985,9 +5735,9 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6029,16 +5779,13 @@ pub mod registry_code_containers { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] #[doc = r" until the operation completes, use"] @@ -6048,9 +5795,9 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) body: models::CodeContainerResource, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) body: models::BatchEndpointTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6078,37 +5825,63 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod delete { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6117,6 +5890,11 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -6175,8 +5953,9 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6188,14 +5967,15 @@ pub mod registry_code_containers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -6203,154 +5983,79 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } } -} -pub mod registry_code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) } } impl From for azure_core::Response { @@ -6363,131 +6068,89 @@ pub mod registry_code_versions { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } - pub mod get { + pub mod list_keys { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6496,9 +6159,9 @@ pub mod registry_code_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; + let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6541,9 +6204,8 @@ pub mod registry_code_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6555,7 +6217,7 @@ pub mod registry_code_versions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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( @@ -6563,32 +6225,25 @@ pub mod registry_code_versions { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6599,255 +6254,8 @@ pub mod registry_code_versions { } } } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } } -pub mod registry_component_containers { +pub mod batch_deployments { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6855,93 +6263,135 @@ pub mod registry_component_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List containers."] + #[doc = "Lists Batch inference deployments in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Endpoint name"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + order_by: None, + top: None, skip: None, } } - #[doc = "Get container."] + #[doc = "Gets a batch inference deployment by id."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch deployments."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates/updates a batch inference deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] + #[doc = "* `body`: Batch inference deployment definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - body: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Update a batch inference deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - pub fn delete( + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] + #[doc = "* `body`: Batch inference deployment definition object."] + pub fn update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), + } + } + #[doc = "Delete Batch Inference deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Endpoint name"] + #[doc = "* `deployment_name`: Inference deployment identifier."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } } @@ -6954,9 +6404,9 @@ pub mod registry_component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6999,10 +6449,23 @@ pub mod registry_component_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Top of list."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); @@ -7010,7 +6473,7 @@ pub mod registry_component_containers { } pub fn into_stream( self, - ) -> azure_core::Pageable { + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -7031,7 +6494,7 @@ pub mod registry_component_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7045,6 +6508,12 @@ pub mod registry_component_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -7066,17 +6535,11 @@ pub mod registry_component_containers { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -7091,9 +6554,9 @@ pub mod registry_component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7136,8 +6599,9 @@ pub mod registry_component_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7163,25 +6627,18 @@ pub mod registry_component_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7201,9 +6658,9 @@ pub mod registry_component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7245,16 +6702,13 @@ pub mod registry_component_containers { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] #[doc = r" until the operation completes, use"] @@ -7264,9 +6718,10 @@ pub mod registry_component_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) body: models::ComponentContainerResource, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::BatchDeploymentTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7293,38 +6748,57 @@ pub mod registry_component_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod delete { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7333,6 +6807,11 @@ pub mod registry_component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -7391,8 +6870,10 @@ pub mod registry_component_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7404,147 +6885,272 @@ pub mod registry_component_containers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } } -} -pub mod registry_component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - order_by: None, - top: None, - skip: None, + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) } } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Create or update version."] - #[doc = ""] + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + Ok(url) + } + } + } +} +pub mod code_containers { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List containers."] + #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + } + } + #[doc = "Get container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + } + } + #[doc = "Create or update container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - body: impl Into, + workspace_name: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } } @@ -7557,9 +7163,9 @@ pub mod registry_component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7602,29 +7208,16 @@ pub mod registry_component_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, + pub(crate) workspace_name: String, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -7645,7 +7238,7 @@ pub mod registry_component_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7659,12 +7252,6 @@ pub mod registry_component_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -7686,11 +7273,17 @@ pub mod registry_component_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -7705,9 +7298,9 @@ pub mod registry_component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7750,9 +7343,8 @@ pub mod registry_component_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7778,18 +7370,25 @@ pub mod registry_component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7809,9 +7408,9 @@ pub mod registry_component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7820,9 +7419,6 @@ pub mod registry_component_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -7834,48 +7430,32 @@ pub mod registry_component_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) body: models::CodeContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7902,22 +7482,27 @@ pub mod registry_component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -7941,9 +7526,6 @@ pub mod registry_component_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -7955,47 +7537,31 @@ pub mod registry_component_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8021,18 +7587,25 @@ pub mod registry_component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } } -pub mod registry_data_containers { +pub mod code_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8040,94 +7613,107 @@ pub mod registry_data_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List containers."] + #[doc = "List versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, skip: None, - list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } - #[doc = "Create or update container."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, name: impl Into, - body: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } } @@ -8140,9 +7726,9 @@ pub mod registry_data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8185,22 +7771,29 @@ pub mod registry_data_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -8221,7 +7814,7 @@ pub mod registry_data_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8235,12 +7828,15 @@ pub mod registry_data_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -8260,16 +7856,17 @@ pub mod registry_data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -8284,9 +7881,9 @@ pub mod registry_data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8329,8 +7926,9 @@ pub mod registry_data_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8357,24 +7955,25 @@ pub mod registry_data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.name + &self.workspace_name, + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8394,9 +7993,9 @@ pub mod registry_data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8405,9 +8004,6 @@ pub mod registry_data_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -8419,47 +8015,33 @@ pub mod registry_data_containers { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::DataContainerResource, + pub(crate) version: String, + pub(crate) body: models::CodeVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8487,28 +8069,27 @@ pub mod registry_data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.name + &self.workspace_name, + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -8532,9 +8113,6 @@ pub mod registry_data_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -8546,46 +8124,32 @@ pub mod registry_data_containers { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8612,24 +8176,25 @@ pub mod registry_data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.name + &self.workspace_name, + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } } -pub mod registry_data_versions { +pub mod component_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8637,109 +8202,94 @@ pub mod registry_data_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List data versions in the data container"] + #[doc = "List component containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `name`: Data container's name"] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, + workspace_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - order_by: None, - top: None, + workspace_name: workspace_name.into(), skip: None, - tags: None, list_view_type: None, } } - #[doc = "Get version."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } - #[doc = "Create or update version."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, name: impl Into, - version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } } @@ -8752,9 +8302,9 @@ pub mod registry_data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8797,41 +8347,24 @@ pub mod registry_data_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, + pub(crate) workspace_name: String, pub(crate) skip: Option, - pub(crate) tags: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] + #[doc = "View type for including/excluding (for example) archived entities."] pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -8852,7 +8385,7 @@ pub mod registry_data_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8866,18 +8399,9 @@ pub mod registry_data_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -8900,17 +8424,16 @@ pub mod registry_data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -8925,9 +8448,9 @@ pub mod registry_data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8970,9 +8493,8 @@ pub mod registry_data_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8999,25 +8521,24 @@ pub mod registry_data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9037,9 +8558,9 @@ pub mod registry_data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9048,9 +8569,6 @@ pub mod registry_data_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -9062,48 +8580,32 @@ pub mod registry_data_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, + pub(crate) body: models::ComponentContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9131,29 +8633,26 @@ pub mod registry_data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -9177,9 +8676,6 @@ pub mod registry_data_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -9191,47 +8687,31 @@ pub mod registry_data_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9258,25 +8738,24 @@ pub mod registry_data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } } -pub mod registry_environment_containers { +pub mod component_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9284,94 +8763,108 @@ pub mod registry_environment_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List environment containers."] + #[doc = "List component versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Component name."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, skip: None, list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } - #[doc = "Create or update container."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - body: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } } @@ -9384,9 +8877,9 @@ pub mod registry_environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9429,11 +8922,24 @@ pub mod registry_environment_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); @@ -9444,9 +8950,7 @@ pub mod registry_environment_containers { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -9467,7 +8971,7 @@ pub mod registry_environment_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -9481,6 +8985,12 @@ pub mod registry_environment_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -9505,17 +9015,11 @@ pub mod registry_environment_containers { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -9530,9 +9034,9 @@ pub mod registry_environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9575,8 +9079,9 @@ pub mod registry_environment_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9602,25 +9107,18 @@ pub mod registry_environment_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9640,9 +9138,9 @@ pub mod registry_environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9651,9 +9149,6 @@ pub mod registry_environment_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -9665,47 +9160,33 @@ pub mod registry_environment_containers { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) body: models::EnvironmentContainerResource, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::ComponentVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9732,29 +9213,20 @@ pub mod registry_environment_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -9778,9 +9250,6 @@ pub mod registry_environment_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -9792,46 +9261,32 @@ pub mod registry_environment_containers { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9857,25 +9312,18 @@ pub mod registry_environment_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } } -pub mod registry_environment_versions { +pub mod data_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9883,108 +9331,94 @@ pub mod registry_environment_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List versions."] + #[doc = "List data containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, + workspace_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - order_by: None, - top: None, + workspace_name: workspace_name.into(), skip: None, list_view_type: None, } } - #[doc = "Get version."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } - #[doc = "Create or update version."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - body: impl Into, + workspace_name: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } } @@ -9997,9 +9431,9 @@ pub mod registry_environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10042,24 +9476,11 @@ pub mod registry_environment_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, + pub(crate) workspace_name: String, pub(crate) skip: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); @@ -10070,9 +9491,7 @@ pub mod registry_environment_versions { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -10093,7 +9512,7 @@ pub mod registry_environment_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10107,12 +9526,6 @@ pub mod registry_environment_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -10137,11 +9550,17 @@ pub mod registry_environment_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -10156,9 +9575,9 @@ pub mod registry_environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10201,9 +9620,8 @@ pub mod registry_environment_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10229,18 +9647,25 @@ pub mod registry_environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10260,9 +9685,9 @@ pub mod registry_environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10271,9 +9696,6 @@ pub mod registry_environment_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -10285,48 +9707,32 @@ pub mod registry_environment_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) body: models::DataContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10353,22 +9759,27 @@ pub mod registry_environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -10392,9 +9803,6 @@ pub mod registry_environment_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -10406,47 +9814,31 @@ pub mod registry_environment_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10472,18 +9864,25 @@ pub mod registry_environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } } -pub mod registry_model_containers { +pub mod data_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10491,94 +9890,109 @@ pub mod registry_model_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List model containers."] + #[doc = "List data versions in the data container"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Data container's name"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, skip: None, + tags: None, list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } - #[doc = "Create or update model container."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - body: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } } @@ -10591,9 +10005,9 @@ pub mod registry_model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10636,22 +10050,41 @@ pub mod registry_model_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, + pub(crate) tags: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -10672,7 +10105,7 @@ pub mod registry_model_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10686,9 +10119,18 @@ pub mod registry_model_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("$tags", tags); + } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -10711,16 +10153,17 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -10735,9 +10178,9 @@ pub mod registry_model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10780,8 +10223,9 @@ pub mod registry_model_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10808,24 +10252,25 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.model_name + &self.workspace_name, + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10845,9 +10290,9 @@ pub mod registry_model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10856,9 +10301,6 @@ pub mod registry_model_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -10870,47 +10312,33 @@ pub mod registry_model_containers { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) body: models::ModelContainerResource, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::DataVersionBaseResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10938,28 +10366,27 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.model_name + &self.workspace_name, + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -10983,9 +10410,6 @@ pub mod registry_model_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -10997,47 +10421,33 @@ pub mod registry_model_containers { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - } + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11063,24 +10473,25 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.model_name + &self.workspace_name, + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } } -pub mod registry_model_versions { +pub mod datastores { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11088,112 +10499,122 @@ pub mod registry_model_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List versions."] + #[doc = "List datastores."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, + workspace_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), + workspace_name: workspace_name.into(), skip: None, + count: None, + is_default: None, + names: Vec::new(), + search_text: None, order_by: None, - top: None, - version: None, - description: None, - tags: None, - properties: None, - list_view_type: None, + order_by_asc: None, } } - #[doc = "Get version."] + #[doc = "Get datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Datastore name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } - #[doc = "Create or update version."] + #[doc = "Create or update datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Datastore name."] + #[doc = "* `body`: Datastore entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - body: impl Into, + workspace_name: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), body: body.into(), + skip_validation: None, } } - #[doc = "Delete version."] + #[doc = "Delete datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Datastore name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), + workspace_name: workspace_name.into(), + name: name.into(), + } + } + #[doc = "Get datastore secrets."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Datastore name."] + pub fn list_secrets( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } } @@ -11206,9 +10627,9 @@ pub mod registry_model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11251,16 +10672,14 @@ pub mod registry_model_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, + pub(crate) workspace_name: String, pub(crate) skip: Option, + pub(crate) count: Option, + pub(crate) is_default: Option, + pub(crate) names: Vec, + pub(crate) search_text: Option, pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) list_view_type: Option, + pub(crate) order_by_asc: Option, } impl RequestBuilder { #[doc = "Continuation token for pagination."] @@ -11268,42 +10687,37 @@ pub mod registry_model_versions { self.skip = Some(skip.into()); self } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); + #[doc = "Maximum number of results to return."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); self } - #[doc = "Version identifier."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); + #[doc = "Filter down to the workspace default datastore."] + pub fn is_default(mut self, is_default: bool) -> Self { + self.is_default = Some(is_default); self } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); + #[doc = "Names of datastores to return."] + pub fn names(mut self, names: Vec) -> Self { + self.names = names; self } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); + #[doc = "Text to search for in the datastore names."] + pub fn search_text(mut self, search_text: impl Into) -> Self { + self.search_text = Some(search_text.into()); self } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); + #[doc = "Order by property (createdtime | modifiedtime | name)."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); + #[doc = "Order by property in ascending order."] + pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { + self.order_by_asc = Some(order_by_asc); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -11324,7 +10738,7 @@ pub mod registry_model_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11341,26 +10755,20 @@ pub mod registry_model_versions { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); + if let Some(is_default) = &this.is_default { + req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); + if let Some(search_text) = &this.search_text { + req.url_mut().query_pairs_mut().append_pair("searchText", search_text); } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + if let Some(order_by_asc) = &this.order_by_asc { + req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11381,17 +10789,16 @@ pub mod registry_model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.model_name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -11406,9 +10813,9 @@ pub mod registry_model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11451,9 +10858,8 @@ pub mod registry_model_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11480,25 +10886,24 @@ pub mod registry_model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11518,9 +10923,9 @@ pub mod registry_model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11529,9 +10934,6 @@ pub mod registry_model_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -11543,50 +10945,40 @@ pub mod registry_model_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) body: models::DatastoreResource, + pub(crate) skip_validation: Option, } impl RequestBuilder { + #[doc = "Flag to skip validation."] + pub fn skip_validation(mut self, skip_validation: bool) -> Self { + self.skip_validation = Some(skip_validation); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11603,6 +10995,11 @@ pub mod registry_model_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(skip_validation) = &this.skip_validation { + req.url_mut() + .query_pairs_mut() + .append_pair("skipValidation", &skip_validation.to_string()); + } req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -11612,29 +11009,26 @@ pub mod registry_model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -11658,9 +11052,6 @@ pub mod registry_model_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -11672,47 +11063,31 @@ pub mod registry_model_versions { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11739,25 +11114,128 @@ pub mod registry_model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + Ok(url) + } + } + } + pub mod list_secrets { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DatastoreSecretsUnion = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod batch_endpoints { +pub mod environment_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11765,7 +11243,7 @@ pub mod batch_endpoints { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists Batch inference endpoint in the workspace."] + #[doc = "List environment containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -11782,124 +11260,77 @@ pub mod batch_endpoints { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - count: None, skip: None, + list_view_type: None, } } - #[doc = "Gets a batch inference endpoint by name."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), } } - #[doc = "Creates a batch inference endpoint (asynchronous)."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Batch inference endpoint definition object."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Mutable batch inference endpoint definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), body: body.into(), } } - #[doc = "Delete Batch Inference Endpoint (asynchronous)."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Lists batch Inference Endpoint keys."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), } } } @@ -11912,9 +11343,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11958,23 +11389,23 @@ pub mod batch_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) count: Option, pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } pub fn into_stream( self, - ) -> azure_core::Pageable { + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -11995,7 +11426,7 @@ pub mod batch_endpoints { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12009,12 +11440,12 @@ pub mod batch_endpoints { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -12034,7 +11465,7 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -12043,7 +11474,7 @@ pub mod batch_endpoints { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -12058,9 +11489,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12104,7 +11535,7 @@ pub mod batch_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12131,25 +11562,25 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] @@ -12168,9 +11599,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12179,9 +11610,6 @@ pub mod batch_endpoints { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -12193,47 +11621,32 @@ pub mod batch_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::BatchEndpointTrackedResource, + pub(crate) name: String, + pub(crate) body: models::EnvironmentContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12261,28 +11674,26 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -12291,7 +11702,7 @@ pub mod batch_endpoints { } } } - pub mod update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12300,20 +11711,12 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -12325,47 +11728,31 @@ pub mod batch_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12377,15 +11764,14 @@ pub mod batch_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -12393,105 +11779,165 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) +} +pub mod environment_versions { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List versions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, + skip: None, + list_view_type: None, } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Get version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Creates or updates an EnvironmentVersion."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] + #[doc = "* `version`: Version of EnvironmentVersion."] + #[doc = "* `body`: Definition of EnvironmentVersion."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), + body: body.into(), } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + #[doc = "Delete version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + Ok(body) } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } #[derive(Clone)] @@ -12500,67 +11946,129 @@ pub mod batch_endpoints { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream( + self, + ) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2022-05-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()), + ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } + 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) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } - pub mod list_keys { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12569,9 +12077,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12615,7 +12123,8 @@ pub mod batch_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12627,7 +12136,7 @@ pub mod batch_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -12635,25 +12144,24 @@ pub mod batch_endpoints { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -12664,160 +12172,19 @@ pub mod batch_endpoints { } } } -} -pub mod batch_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference deployments in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Gets a batch inference deployment by id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch deployments."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Creates/updates a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: Inference deployment identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; - Ok(body) + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { self.0 @@ -12860,102 +12227,58 @@ pub mod batch_deployments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::EnvironmentVersionResource, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12964,11 +12287,6 @@ pub mod batch_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -13010,8 +12328,8 @@ pub mod batch_deployments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13023,7 +12341,7 @@ pub mod batch_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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( @@ -13037,12059 +12355,18 @@ pub mod batch_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::BatchDeploymentTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::CodeContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod component_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List component containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ComponentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List component versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Component name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod data_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::DataContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod data_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data versions in the data container"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Data container's name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - tags: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod datastores { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List datastores."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - count: None, - is_default: None, - names: Vec::new(), - search_text: None, - order_by: None, - order_by_asc: None, - } - } - #[doc = "Get datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - #[doc = "* `body`: Datastore entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - skip_validation: None, - } - } - #[doc = "Delete datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Get datastore secrets."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn list_secrets( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) is_default: Option, - pub(crate) names: Vec, - pub(crate) search_text: Option, - pub(crate) order_by: Option, - pub(crate) order_by_asc: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Filter down to the workspace default datastore."] - pub fn is_default(mut self, is_default: bool) -> Self { - self.is_default = Some(is_default); - self - } - #[doc = "Names of datastores to return."] - pub fn names(mut self, names: Vec) -> Self { - self.names = names; - self - } - #[doc = "Text to search for in the datastore names."] - pub fn search_text(mut self, search_text: impl Into) -> Self { - self.search_text = Some(search_text.into()); - self - } - #[doc = "Order by property (createdtime | modifiedtime | name)."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Order by property in ascending order."] - pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { - self.order_by_asc = Some(order_by_asc); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(is_default) = &this.is_default { - req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); - } - if let Some(search_text) = &this.search_text { - req.url_mut().query_pairs_mut().append_pair("searchText", search_text); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); - } - if let Some(order_by_asc) = &this.order_by_asc { - req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::DatastoreResource, - pub(crate) skip_validation: Option, - } - impl RequestBuilder { - #[doc = "Flag to skip validation."] - pub fn skip_validation(mut self, skip_validation: bool) -> Self { - self.skip_validation = Some(skip_validation); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(skip_validation) = &this.skip_validation { - req.url_mut() - .query_pairs_mut() - .append_pair("skipValidation", &skip_validation.to_string()); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod list_secrets { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreSecretsUnion = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod environment_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List environment containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::EnvironmentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod environment_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Creates or updates an EnvironmentVersion."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] - #[doc = "* `version`: Version of EnvironmentVersion."] - #[doc = "* `body`: Definition of EnvironmentVersion."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featureset_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List featurestore entity containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - tags: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get_entity( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get_entity::RequestBuilder { - get_entity::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get_entity { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::FeaturesetContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featureset_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Featureset name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - tags: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Backfill."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Feature set version backfill request entity."] - pub fn backfill( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> backfill::RequestBuilder { - backfill::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Get feature."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Feature set name. This is case-sensitive."] - #[doc = "* `version`: Feature set version identifier. This is case-sensitive."] - #[doc = "* `body`: Feature Name request. This is case-sensitive."] - pub fn get_feature( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> get_feature::RequestBuilder { - get_feature::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "List Features."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Featureset name. This is case-sensitive."] - #[doc = "* `version`: Featureset Version identifier. This is case-sensitive."] - pub fn list_features( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> list_features::RequestBuilder { - list_features::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - skip: None, - tags: None, - } - } - #[doc = "List materialization Jobs."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn list_materialization_jobs( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> list_materialization_jobs::RequestBuilder { - list_materialization_jobs::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - skip: None, - filters: None, - feature_window_start: None, - feature_window_end: None, - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturesetVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod backfill { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionBackfillResponse = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturesetVersionBackfillRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/backfill" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod get_feature { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Feature = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::GetFeatureRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/getFeature" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_features { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeatureArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - 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()), - ); - 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, "2023-02-01-preview"); - } - 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::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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/listFeatures" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod list_materialization_jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetJobArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) skip: Option, - pub(crate) filters: Option, - pub(crate) feature_window_start: Option, - pub(crate) feature_window_end: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn filters(mut self, filters: impl Into) -> Self { - self.filters = Some(filters.into()); - self - } - #[doc = "Start time of the feature window to filter materialization jobs."] - pub fn feature_window_start(mut self, feature_window_start: impl Into) -> Self { - self.feature_window_start = Some(feature_window_start.into()); - self - } - #[doc = "End time of the feature window to filter materialization jobs."] - pub fn feature_window_end(mut self, feature_window_end: impl Into) -> Self { - self.feature_window_end = Some(feature_window_end.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - 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()), - ); - 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, "2023-02-01-preview"); - } - 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::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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(filters) = &this.filters { - req.url_mut().query_pairs_mut().append_pair("filters", filters); - } - if let Some(feature_window_start) = &this.feature_window_start { - req.url_mut() - .query_pairs_mut() - .append_pair("featureWindowStart", feature_window_start); - } - if let Some(feature_window_end) = &this.feature_window_end { - req.url_mut().query_pairs_mut().append_pair("featureWindowEnd", feature_window_end); - } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/listMaterializationJobs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featurestore_entity_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List featurestore entity containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - tags: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get_entity( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get_entity::RequestBuilder { - get_entity::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get_entity { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::FeaturestoreEntityContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featurestore_entity_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Feature entity name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - tags: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturestoreEntityVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Jobs in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - job_type: None, - tag: None, - list_view_type: None, - asset_name: None, - scheduled: None, - schedule_id: None, - } - } - #[doc = "Gets a Job by name/id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Creates and executes a Job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - #[doc = "* `body`: Job definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Deletes a Job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Cancels a Job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn cancel( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> cancel::RequestBuilder { - cancel::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) job_type: Option, - pub(crate) tag: Option, - pub(crate) list_view_type: Option, - pub(crate) asset_name: Option, - pub(crate) scheduled: Option, - pub(crate) schedule_id: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Type of job to be returned."] - pub fn job_type(mut self, job_type: impl Into) -> Self { - self.job_type = Some(job_type.into()); - self - } - #[doc = "Jobs returned will have this tag key."] - pub fn tag(mut self, tag: impl Into) -> Self { - self.tag = Some(tag.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "Asset name the job's named output is registered with"] - pub fn asset_name(mut self, asset_name: impl Into) -> Self { - self.asset_name = Some(asset_name.into()); - self - } - #[doc = "Indicator whether the job is scheduled job."] - pub fn scheduled(mut self, scheduled: bool) -> Self { - self.scheduled = Some(scheduled); - self - } - #[doc = "The scheduled id for listing the job triggered from"] - pub fn schedule_id(mut self, schedule_id: impl Into) -> Self { - self.schedule_id = Some(schedule_id.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(job_type) = &this.job_type { - req.url_mut().query_pairs_mut().append_pair("jobType", job_type); - } - if let Some(tag) = &this.tag { - req.url_mut().query_pairs_mut().append_pair("tag", tag); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(asset_name) = &this.asset_name { - req.url_mut().query_pairs_mut().append_pair("assetName", asset_name); - } - if let Some(scheduled) = &this.scheduled { - req.url_mut().query_pairs_mut().append_pair("scheduled", &scheduled.to_string()); - } - if let Some(schedule_id) = &this.schedule_id { - req.url_mut().query_pairs_mut().append_pair("scheduleId", schedule_id); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::JobBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod cancel { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod labeling_jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists labeling jobs in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - top: None, - } - } - #[doc = "Gets a labeling job by name/id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - include_job_instructions: None, - include_label_categories: None, - } - } - #[doc = "Creates or updates a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: LabelingJob definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Delete a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Export labels from a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: The export summary."] - pub fn export_labels( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> export_labels::RequestBuilder { - export_labels::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Pause a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn pause( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> pause::RequestBuilder { - pause::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Resume a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn resume( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) top: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Number of labeling jobs to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) include_job_instructions: Option, - pub(crate) include_label_categories: Option, - } - impl RequestBuilder { - #[doc = "Boolean value to indicate whether to include JobInstructions in response."] - pub fn include_job_instructions(mut self, include_job_instructions: bool) -> Self { - self.include_job_instructions = Some(include_job_instructions); - self - } - #[doc = "Boolean value to indicate Whether to include LabelCategories in response."] - pub fn include_label_categories(mut self, include_label_categories: bool) -> Self { - self.include_label_categories = Some(include_label_categories); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(include_job_instructions) = &this.include_job_instructions { - req.url_mut() - .query_pairs_mut() - .append_pair("includeJobInstructions", &include_job_instructions.to_string()); - } - if let Some(include_label_categories) = &this.include_label_categories { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLabelCategories", &include_label_categories.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::LabelingJobResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod export_labels { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExportSummaryUnion = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::ExportSummaryUnion, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/exportLabels" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod pause { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/pause", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod resume { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/resume" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod model_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - count: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ModelContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } -} -pub mod model_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Model name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - order_by: None, - top: None, - version: None, - description: None, - offset: None, - tags: None, - properties: None, - feed: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Model Version Package operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Package operation request body."] - pub fn package( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> package::RequestBuilder { - package::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) offset: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) feed: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Model version."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Number of initial results to skip."] - pub fn offset(mut self, offset: i32) -> Self { - self.offset = Some(offset); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "Name of the feed."] - pub fn feed(mut self, feed: impl Into) -> Self { - self.feed = Some(feed.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(offset) = &this.offset { - req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(feed) = &this.feed { - req.url_mut().query_pairs_mut().append_pair("feed", feed); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - } - pub mod package { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageResponse = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::PackageRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}/package" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } } } -pub mod online_endpoints { +pub mod jobs { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -25097,7 +12374,7 @@ pub mod online_endpoints { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List Online Endpoints."] + #[doc = "Lists Jobs in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -25114,176 +12391,101 @@ pub mod online_endpoints { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: None, - count: None, - compute_type: None, skip: None, - tags: None, - properties: None, - order_by: None, + job_type: None, + tag: None, + list_view_type: None, } } - #[doc = "Get Online Endpoint."] + #[doc = "Gets a Job by name/id."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + id: id.into(), } } - #[doc = "Create or update Online Endpoint (asynchronous)."] + #[doc = "Creates and executes a Job."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + #[doc = "* `body`: Job definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, + id: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + id: id.into(), body: body.into(), } } - #[doc = "Delete Online Endpoint (asynchronous)."] + #[doc = "Deletes a Job (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: RegenerateKeys request ."] - pub fn regenerate_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> regenerate_keys::RequestBuilder { - regenerate_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), + id: id.into(), } } - #[doc = "Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication."] + #[doc = "Cancels a Job (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn get_token( + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + pub fn cancel( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get_token::RequestBuilder { - get_token::RequestBuilder { + id: impl Into, + ) -> cancel::RequestBuilder { + cancel::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + id: id.into(), } } } @@ -25296,9 +12498,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -25342,53 +12544,33 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: Option, - pub(crate) count: Option, - pub(crate) compute_type: Option, pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) order_by: Option, + pub(crate) job_type: Option, + pub(crate) tag: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Name of the endpoint."] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "EndpointComputeType to be filtered by."] - pub fn compute_type(mut self, compute_type: impl Into) -> Self { - self.compute_type = Some(compute_type.into()); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); + #[doc = "Type of job to be returned."] + pub fn job_type(mut self, job_type: impl Into) -> Self { + self.job_type = Some(job_type.into()); self } - #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); + #[doc = "Jobs returned will have this tag key."] + pub fn tag(mut self, tag: impl Into) -> Self { + self.tag = Some(tag.into()); self } - #[doc = "The option to order the response."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -25409,7 +12591,7 @@ pub mod online_endpoints { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -25423,26 +12605,17 @@ pub mod online_endpoints { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(compute_type) = &this.compute_type { - req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); + if let Some(job_type) = &this.job_type { + req.url_mut().query_pairs_mut().append_pair("jobType", job_type); } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); + if let Some(tag) = &this.tag { + req.url_mut().query_pairs_mut().append_pair("tag", tag); } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -25463,7 +12636,7 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -25472,7 +12645,7 @@ pub mod online_endpoints { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -25487,9 +12660,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -25533,7 +12706,7 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -25560,24 +12733,24 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -25597,9 +12770,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -25608,9 +12781,6 @@ pub mod online_endpoints { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -25622,47 +12792,32 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::OnlineEndpointTrackedResource, + pub(crate) id: String, + pub(crate) body: models::JobBaseResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -25690,28 +12845,26 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -25720,7 +12873,7 @@ pub mod online_endpoints { } } } - pub mod update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -25729,11 +12882,6 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -25793,8 +12941,7 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, + pub(crate) id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -25806,79 +12953,246 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + Ok(url) + } + } + } + pub mod cancel { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - Ok(url) + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + Ok(url) + } + } + } +} +pub mod model_containers { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List model containers."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + count: None, + list_view_type: None, + } + } + #[doc = "Get container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + } + } + #[doc = "Create or update container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + body: body.into(), } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + #[doc = "Delete container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } } - pub mod delete { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -25887,15 +13201,17 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ModelContainerResourceArmPaginatedResult = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -25907,89 +13223,129 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) skip: Option, + pub(crate) count: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "Maximum number of results to return."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2022-05-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } + 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) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", self.client.endpoint(), &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name + &self.resource_group_name, + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } - pub mod list_keys { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -25998,9 +13354,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26044,7 +13400,7 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -26056,7 +13412,7 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -26064,25 +13420,31 @@ pub mod online_endpoints { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -26093,7 +13455,7 @@ pub mod online_endpoints { } } } - pub mod regenerate_keys { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -26102,15 +13464,17 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ModelContainerResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -26122,42 +13486,32 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::RegenerateEndpointKeysRequest, + pub(crate) name: String, + pub(crate) body: models::ModelContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -26169,7 +13523,7 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -26184,17 +13538,36 @@ pub mod online_endpoints { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_token { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -26203,11 +13576,6 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthToken = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -26249,7 +13617,7 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -26261,7 +13629,7 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -26269,37 +13637,31 @@ pub mod online_endpoints { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod online_deployments { +pub mod model_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -26307,190 +13669,114 @@ pub mod online_deployments { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List Inference Endpoint Deployments."] + #[doc = "List model versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `name`: Model name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), + skip: None, order_by: None, top: None, - skip: None, + version: None, + description: None, + offset: None, + tags: None, + properties: None, + feed: None, + list_view_type: None, } } - #[doc = "Get Inference Deployment Deployment."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, + name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), + name: name.into(), + version: version.into(), } } - #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Inference Endpoint entity to apply during operation."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Polls an Endpoint operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: The name and identifier for the endpoint."] - #[doc = "* `body`: The request containing parameters for retrieving logs."] - pub fn get_logs( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> get_logs::RequestBuilder { - get_logs::RequestBuilder { + name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), + name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "List Inference Endpoint Deployment Skus."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn list_skus( + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> list_skus::RequestBuilder { - list_skus::RequestBuilder { + name: impl Into, + version: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - count: None, - skip: None, + name: name.into(), + version: version.into(), } } } @@ -26503,9 +13789,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26549,30 +13835,70 @@ pub mod online_deployments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, + pub(crate) skip: Option, pub(crate) order_by: Option, pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) version: Option, + pub(crate) description: Option, + pub(crate) offset: Option, + pub(crate) tags: Option, + pub(crate) properties: Option, + pub(crate) feed: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } #[doc = "Ordering of list."] pub fn order_by(mut self, order_by: impl Into) -> Self { self.order_by = Some(order_by.into()); self } - #[doc = "Top of list."] + #[doc = "Maximum number of records to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); + #[doc = "Model version."] + pub fn version(mut self, version: impl Into) -> Self { + self.version = Some(version.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + #[doc = "Model description."] + pub fn description(mut self, description: impl Into) -> Self { + self.description = Some(description.into()); + self + } + #[doc = "Number of initial results to skip."] + pub fn offset(mut self, offset: i32) -> Self { + self.offset = Some(offset); + self + } + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] + pub fn properties(mut self, properties: impl Into) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "Name of the feed."] + pub fn feed(mut self, feed: impl Into) -> Self { + self.feed = Some(feed.into()); + self + } + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -26593,7 +13919,7 @@ pub mod online_deployments { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -26607,14 +13933,35 @@ pub mod online_deployments { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } if let Some(order_by) = &this.order_by { req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); + if let Some(version) = &this.version { + req.url_mut().query_pairs_mut().append_pair("version", version); + } + if let Some(description) = &this.description { + req.url_mut().query_pairs_mut().append_pair("description", description); + } + if let Some(offset) = &this.offset { + req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(properties) = &this.properties { + req.url_mut().query_pairs_mut().append_pair("properties", properties); + } + if let Some(feed) = &this.feed { + req.url_mut().query_pairs_mut().append_pair("feed", feed); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -26634,11 +13981,18 @@ pub mod online_deployments { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -26653,9 +14007,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26699,8 +14053,8 @@ pub mod online_deployments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -26726,18 +14080,26 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -26757,9 +14119,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26768,9 +14130,6 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -26782,48 +14141,141 @@ pub mod online_deployments { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::ModelVersionResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::OnlineDeploymentTrackedResource, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -26835,46 +14287,238 @@ pub mod online_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod online_endpoints { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List Online Endpoints."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: None, + count: None, + compute_type: None, + skip: None, + tags: None, + properties: None, + order_by: None, + } + } + #[doc = "Get Online Endpoint."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } + } + #[doc = "Create or update Online Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), + } + } + #[doc = "Update Online Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), + } + } + #[doc = "Delete Online Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } + } + #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } + } + #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: RegenerateKeys request ."] + pub fn regenerate_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> regenerate_keys::RequestBuilder { + regenerate_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), + } + } + #[doc = "Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn get_token( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> get_token::RequestBuilder { + get_token::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), } } } - pub mod update { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -26883,9 +14527,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26894,9 +14538,6 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -26908,125 +14549,167 @@ pub mod online_deployments { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithSku, + pub(crate) name: Option, + pub(crate) count: Option, + pub(crate) compute_type: Option, + pub(crate) skip: Option, + pub(crate) tags: Option, + pub(crate) properties: Option, + pub(crate) order_by: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Name of the endpoint."] + pub fn name(mut self, name: impl Into) -> Self { + self.name = Some(name.into()); + self + } + #[doc = "Number of endpoints to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } + #[doc = "EndpointComputeType to be filtered by."] + pub fn compute_type(mut self, compute_type: impl Into) -> Self { + self.compute_type = Some(compute_type.into()); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] + pub fn properties(mut self, properties: impl Into) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "The option to order the response."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + pub fn into_stream( + self, + ) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2022-05-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()), + ); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } + if let Some(compute_type) = &this.compute_type { + req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(properties) = &this.properties { + req.url_mut().query_pairs_mut().append_pair("properties", properties); + } + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + } + 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) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } } - pub mod delete { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27035,15 +14718,17 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineEndpointTrackedResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27052,23 +14737,7 @@ pub mod online_deployments { } impl AsRef for Response { fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + self.as_raw_response() } } #[derive(Clone)] @@ -27077,25 +14746,25 @@ pub mod online_deployments { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -27107,7 +14776,7 @@ pub mod online_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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( @@ -27121,17 +14790,36 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_logs { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27140,9 +14828,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentLogs = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -27151,6 +14839,9 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27162,33 +14853,44 @@ pub mod online_deployments { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::DeploymentLogsRequest, + pub(crate) body: models::OnlineEndpointTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -27200,7 +14902,7 @@ pub mod online_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -27215,29 +14917,64 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod list_skus { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27246,9 +14983,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SkuResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -27257,6 +14994,9 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27268,216 +15008,131 @@ pub mod online_deployments { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, + pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, } impl RequestBuilder { - #[doc = "Number of Skus to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } - } -} -pub mod schedules { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List schedules in specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - #[doc = "* `body`: Schedule definition."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod list { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27486,17 +15141,15 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResourceArmPaginatedResult = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27508,120 +15161,89 @@ pub mod schedules { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, + pub(crate) endpoint_name: String, } impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Status filter for schedule."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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 + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } - pub mod get { + pub mod list_keys { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27630,9 +15252,9 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; + let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -27676,7 +15298,7 @@ pub mod schedules { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -27688,7 +15310,7 @@ pub mod schedules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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( @@ -27696,31 +15318,25 @@ pub mod schedules { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -27731,7 +15347,7 @@ pub mod schedules { } } } - pub mod create_or_update { + pub mod regenerate_keys { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27740,11 +15356,6 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -27767,15 +15378,13 @@ pub mod schedules { } pub struct Headers<'a>(&'a azure_core::headers::Headers); impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) } } #[derive(Clone)] @@ -27784,16 +15393,13 @@ pub mod schedules { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] #[doc = r" until the operation completes, use"] @@ -27804,8 +15410,8 @@ pub mod schedules { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ScheduleResource, + pub(crate) endpoint_name: String, + pub(crate) body: models::RegenerateEndpointKeysRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -27817,7 +15423,7 @@ pub mod schedules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + 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( @@ -27832,38 +15438,17 @@ pub mod schedules { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod delete { + pub mod get_token { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27872,15 +15457,17 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EndpointAuthToken = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27892,46 +15479,31 @@ pub mod schedules { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -27943,7 +15515,7 @@ pub mod schedules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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( @@ -27951,31 +15523,37 @@ pub mod schedules { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod registries { +pub mod online_deployments { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -27983,114 +15561,194 @@ pub mod registries { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List registries by subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - skip: None, - } - } - #[doc = "List registries"] + #[doc = "List Inference Endpoint Deployments."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + order_by: None, + top: None, skip: None, } } - #[doc = "Get registry"] + #[doc = "Get Inference Deployment Deployment."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } - #[doc = "Create or update registry"] + #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `body`: Inference Endpoint entity to apply during operation."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Update tags"] + #[doc = "Update Online Deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] pub fn update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), + } + } + #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + } + } + #[doc = "Polls an Endpoint operation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: The name and identifier for the endpoint."] + #[doc = "* `body`: The request containing parameters for retrieving logs."] + pub fn get_logs( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> get_logs::RequestBuilder { + get_logs::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Delete registry."] + #[doc = "List Inference Endpoint Deployment Skus."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - pub fn delete( + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn list_skus( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> list_skus::RequestBuilder { + list_skus::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + count: None, + skip: None, } } } - pub mod list_by_subscription { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -28099,9 +15757,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -28143,15 +15801,32 @@ pub mod registries { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Top of list."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -28172,7 +15847,7 @@ pub mod registries { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -28186,6 +15861,12 @@ pub mod registries { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -28207,21 +15888,17 @@ pub mod registries { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } } - pub mod list { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -28230,9 +15907,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -28275,86 +15952,206 @@ pub mod registries { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) skip: Option, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, } impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineDeploymentTrackedResource = 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 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::OnlineDeploymentTrackedResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2023-02-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } } - pub mod get { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -28363,9 +16160,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -28374,6 +16171,9 @@ pub mod registries { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -28385,30 +16185,48 @@ pub mod registries { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::PartialMinimalTrackedResourceWithSku, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -28420,49 +16238,72 @@ pub mod registries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod create_or_update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -28471,17 +16312,15 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -28493,6 +16332,22 @@ pub mod registries { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -28515,8 +16370,9 @@ pub mod registries { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::RegistryTrackedResource, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -28528,113 +16384,31 @@ pub mod registries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::AzureAsyncOperation)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) + Ok(url) } } } - pub mod update { + pub mod get_logs { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -28643,9 +16417,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::DeploymentLogs = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -28654,9 +16428,6 @@ pub mod registries { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -28668,41 +16439,33 @@ pub mod registries { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::PartialRegistryPartialTrackedResource, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::DeploymentLogsRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -28714,7 +16477,7 @@ pub mod registries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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( @@ -28729,98 +16492,29 @@ pub mod registries { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod delete { + pub mod list_skus { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -28829,15 +16523,17 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SkuResourceArmPaginatedResult = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -28849,81 +16545,110 @@ pub mod registries { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) count: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Number of Skus to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2022-05-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()), + ); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } @@ -29036,7 +16761,7 @@ pub mod workspace_features { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -29078,7 +16803,7 @@ pub mod workspace_features { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } Ok(url) } diff --git a/services/mgmt/machinelearningservices/src/package_preview_2023_02/models.rs b/services/mgmt/machinelearningservices/src/package_2022_05_01/models.rs similarity index 55% rename from services/mgmt/machinelearningservices/src/package_preview_2023_02/models.rs rename to services/mgmt/machinelearningservices/src/package_2022_05_01/models.rs index 14d3cfffb7..baa1fe3c80 100644 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_02/models.rs +++ b/services/mgmt/machinelearningservices/src/package_2022_05_01/models.rs @@ -163,21 +163,6 @@ pub mod aks_schema { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccessKeyAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl AccessKeyAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} #[doc = "Account key datastore credentials configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccountKeyDatastoreCredentials { @@ -211,19 +196,6 @@ impl AccountKeyDatastoreSecrets { } } } -#[doc = "Details of ACR account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AcrDetails { - #[serde(rename = "systemCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_acr_account: Option, - #[serde(rename = "userCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_acr_account: Option, -} -impl AcrDetails { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Secrets related to a Machine Learning compute based on AKS."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AksComputeSecrets { @@ -279,17 +251,6 @@ impl AksNetworkingConfiguration { Self::default() } } -#[doc = "All nodes means the service will be running on all of the nodes of the job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AllNodes { - #[serde(flatten)] - pub nodes: Nodes, -} -impl AllNodes { - pub fn new(nodes: Nodes) -> Self { - Self { nodes } - } -} #[doc = "An Azure Machine Learning compute."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AmlCompute { @@ -651,7 +612,7 @@ impl AmlComputeSchema { Self::default() } } -#[doc = "Azure Machine Learning REST API operation"] +#[doc = "Azure Machine Learning workspace REST API operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AmlOperation { #[doc = "Operation name: {provider}/{resource}/{operation}"] @@ -696,7 +657,7 @@ pub mod aml_operation { #[doc = "An array of operations supported by the resource provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AmlOperationListResult { - #[doc = "List of AML operations supported by the AML resource provider."] + #[doc = "List of AML workspace operations supported by the AML workspace resource provider."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -744,18 +705,6 @@ impl AmlUserFeature { Self::default() } } -#[doc = "ARM ResourceId of a resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArmResourceId { - #[doc = "Arm ResourceId is in the format \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}\"\r\nor \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}\""] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl ArmResourceId { - pub fn new() -> Self { - Self::default() - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssetBase { #[serde(flatten)] @@ -808,12 +757,6 @@ impl AssetJobInput { #[doc = "Asset output type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssetJobOutput { - #[doc = "Output Asset Name."] - #[serde(rename = "assetName", default, skip_serializing_if = "Option::is_none")] - pub asset_name: Option, - #[doc = "Output Asset Version."] - #[serde(rename = "assetVersion", default, skip_serializing_if = "Option::is_none")] - pub asset_version: Option, #[doc = "Output data delivery mode enums."] #[serde(default, skip_serializing_if = "Option::is_none")] pub mode: Option, @@ -826,51 +769,6 @@ impl AssetJobOutput { Self::default() } } -#[doc = "Provisioning state of registry asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AssetProvisioningState")] -pub enum AssetProvisioningState { - Succeeded, - Failed, - Canceled, - Creating, - Updating, - Deleting, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AssetProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AssetProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AssetProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("AssetProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("AssetProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("AssetProvisioningState", 2u32, "Canceled"), - Self::Creating => serializer.serialize_unit_variant("AssetProvisioningState", 3u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("AssetProvisioningState", 4u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("AssetProvisioningState", 5u32, "Deleting"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Base definition for asset references."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AssetReferenceBase { @@ -905,103 +803,6 @@ impl AssignedUser { Self { object_id, tenant_id } } } -#[doc = "Forecast horizon determined automatically by system."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoForecastHorizon { - #[serde(flatten)] - pub forecast_horizon: ForecastHorizon, -} -impl AutoForecastHorizon { - pub fn new(forecast_horizon: ForecastHorizon) -> Self { - Self { forecast_horizon } - } -} -#[doc = "AutoMLJob class.\r\nUse this class for executing AutoML tasks like Classification/Regression etc.\r\nSee TaskType enum for all the tasks supported."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoMlJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "The ARM resource ID of the Environment specification for the job.\r\nThis is optional value to provide, if not provided, AutoML will default this to Production AutoML curated environment version when running the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Environment variables included in the job."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, - #[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] - #[serde(rename = "taskDetails")] - pub task_details: AutoMlVerticalUnion, -} -impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVerticalUnion) -> Self { - Self { - job_base, - environment_id: None, - environment_variables: None, - outputs: None, - queue_settings: None, - resources: None, - task_details, - } - } -} -#[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoMlVertical { - #[doc = "Enum for setting log verbosity."] - #[serde(rename = "logVerbosity", default, skip_serializing_if = "Option::is_none")] - pub log_verbosity: Option, - #[doc = "Target column name: This is prediction values column.\r\nAlso known as label column name in context of classification tasks."] - #[serde(rename = "targetColumnName", default, skip_serializing_if = "Option::is_none")] - pub target_column_name: Option, - #[doc = "AutoMLJob Task type."] - #[serde(rename = "taskType")] - pub task_type: TaskType, - #[serde(rename = "trainingData")] - pub training_data: MlTableJobInput, -} -impl AutoMlVertical { - pub fn new(task_type: TaskType, training_data: MlTableJobInput) -> Self { - Self { - log_verbosity: None, - target_column_name: None, - task_type, - training_data, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "taskType")] -pub enum AutoMlVerticalUnion { - Classification(Classification), - Forecasting(Forecasting), - ImageClassification(ImageClassification), - ImageClassificationMultilabel(ImageClassificationMultilabel), - ImageInstanceSegmentation(ImageInstanceSegmentation), - ImageObjectDetection(ImageObjectDetection), - Regression(Regression), - TextClassification(TextClassification), - TextClassificationMultilabel(TextClassificationMultilabel), - #[serde(rename = "TextNER")] - TextNer(TextNer), -} -#[doc = "N-Cross validations determined automatically."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoNCrossValidations { - #[serde(flatten)] - pub n_cross_validations: NCrossValidations, -} -impl AutoNCrossValidations { - pub fn new(n_cross_validations: NCrossValidations) -> Self { - Self { n_cross_validations } - } -} #[doc = "Auto pause properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoPauseProperties { @@ -1015,43 +816,6 @@ impl AutoPauseProperties { Self::default() } } -#[doc = "AutoRebuild setting for the derived image"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AutoRebuildSetting")] -pub enum AutoRebuildSetting { - Disabled, - OnBaseImageUpdate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AutoRebuildSetting { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AutoRebuildSetting { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AutoRebuildSetting { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("AutoRebuildSetting", 0u32, "Disabled"), - Self::OnBaseImageUpdate => serializer.serialize_unit_variant("AutoRebuildSetting", 1u32, "OnBaseImageUpdate"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Auto scale properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoScaleProperties { @@ -1067,56 +831,9 @@ impl AutoScaleProperties { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoSeasonality { - #[serde(flatten)] - pub seasonality: Seasonality, -} -impl AutoSeasonality { - pub fn new(seasonality: Seasonality) -> Self { - Self { seasonality } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoTargetLags { - #[serde(flatten)] - pub target_lags: TargetLags, -} -impl AutoTargetLags { - pub fn new(target_lags: TargetLags) -> Self { - Self { target_lags } - } -} -#[doc = "Target lags rolling window determined automatically."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoTargetRollingWindowSize { - #[serde(flatten)] - pub target_rolling_window_size: TargetRollingWindowSize, -} -impl AutoTargetRollingWindowSize { - pub fn new(target_rolling_window_size: TargetRollingWindowSize) -> Self { - Self { - target_rolling_window_size, - } - } -} -#[doc = "Settings for Autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutologgerSettings { - #[doc = "Enum to determine the state of mlflow autologger."] - #[serde(rename = "mlflowAutologger")] - pub mlflow_autologger: MlFlowAutologgerState, -} -impl AutologgerSettings { - pub fn new(mlflow_autologger: MlFlowAutologgerState) -> Self { - Self { mlflow_autologger } - } -} #[doc = "Azure Blob datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBlobDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "Storage account name."] @@ -1137,7 +854,6 @@ pub struct AzureBlobDatastore { impl AzureBlobDatastore { pub fn new(datastore: Datastore) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name: None, container_name: None, @@ -1150,8 +866,6 @@ impl AzureBlobDatastore { #[doc = "Azure Data Lake Gen1 datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureDataLakeGen1Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] @@ -1163,7 +877,6 @@ pub struct AzureDataLakeGen1Datastore { impl AzureDataLakeGen1Datastore { pub fn new(datastore: Datastore, store_name: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, service_data_access_auth_identity: None, store_name, @@ -1173,8 +886,6 @@ impl AzureDataLakeGen1Datastore { #[doc = "Azure Data Lake Gen2 datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureDataLakeGen2Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "[Required] Storage account name."] @@ -1194,7 +905,6 @@ pub struct AzureDataLakeGen2Datastore { impl AzureDataLakeGen2Datastore { pub fn new(datastore: Datastore, account_name: String, filesystem: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name, endpoint: None, @@ -1204,26 +914,9 @@ impl AzureDataLakeGen2Datastore { } } } -#[doc = "Base definition for Azure datastore contents configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureDatastore { - #[doc = "Azure Resource Group name"] - #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] - pub resource_group: Option, - #[doc = "Azure Subscription Id"] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, -} -impl AzureDatastore { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Azure File datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureFileDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "[Required] Storage account name."] @@ -1244,7 +937,6 @@ pub struct AzureFileDatastore { impl AzureFileDatastore { pub fn new(datastore: Datastore, account_name: String, file_share_name: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name, endpoint: None, @@ -1254,40 +946,6 @@ impl AzureFileDatastore { } } } -#[doc = "Azure ML batch inferencing server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureMlBatchInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, -} -impl AzureMlBatchInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - code_configuration: None, - } - } -} -#[doc = "Azure ML online inferencing configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureMlOnlineInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, -} -impl AzureMlOnlineInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - code_configuration: None, - } - } -} #[doc = "Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BanditPolicy { @@ -1309,76 +967,6 @@ impl BanditPolicy { } } } -#[doc = "Base environment type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BaseEnvironmentId { - #[serde(flatten)] - pub base_environment_source: BaseEnvironmentSource, - #[doc = "[Required] Resource id accepting ArmId or AzureMlId."] - #[serde(rename = "resourceId")] - pub resource_id: String, -} -impl BaseEnvironmentId { - pub fn new(base_environment_source: BaseEnvironmentSource, resource_id: String) -> Self { - Self { - base_environment_source, - resource_id, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BaseEnvironmentSource { - #[doc = "Base environment type."] - #[serde(rename = "baseEnvironmentSourceType")] - pub base_environment_source_type: BaseEnvironmentSourceType, -} -impl BaseEnvironmentSource { - pub fn new(base_environment_source_type: BaseEnvironmentSourceType) -> Self { - Self { - base_environment_source_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "baseEnvironmentSourceType")] -pub enum BaseEnvironmentSourceUnion { - EnvironmentAsset(BaseEnvironmentId), -} -#[doc = "Base environment type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BaseEnvironmentSourceType")] -pub enum BaseEnvironmentSourceType { - EnvironmentAsset, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BaseEnvironmentSourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BaseEnvironmentSourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BaseEnvironmentSourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::EnvironmentAsset => serializer.serialize_unit_variant("BaseEnvironmentSourceType", 0u32, "EnvironmentAsset"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Batch inference settings per deployment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BatchDeployment { @@ -1387,9 +975,6 @@ pub struct BatchDeployment { #[doc = "Compute target for batch inference operation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub compute: Option, - #[doc = "Properties relevant to different deployment types."] - #[serde(rename = "deploymentConfiguration", default, skip_serializing_if = "Option::is_none")] - pub deployment_configuration: Option, #[doc = "Error threshold, if the error count for the entire input goes above this value,\r\nthe batch inference will be aborted. Range is [-1, int.MaxValue].\r\nFor FileDataset, this value is the count of file failures.\r\nFor TabularDataset, this value is the count of record failures.\r\nIf set to -1 (the lower bound), all failures during batch inference will be ignored."] #[serde(rename = "errorThreshold", default, skip_serializing_if = "Option::is_none")] pub error_threshold: Option, @@ -1415,7 +1000,7 @@ pub struct BatchDeployment { #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, + pub resources: Option, #[doc = "Retry settings for a batch inference operation."] #[serde(rename = "retrySettings", default, skip_serializing_if = "Option::is_none")] pub retry_settings: Option, @@ -1425,62 +1010,6 @@ impl BatchDeployment { Self::default() } } -#[doc = "Properties relevant to different deployment types."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchDeploymentConfiguration { - #[doc = "The enumerated property types for batch deployments."] - #[serde(rename = "deploymentConfigurationType")] - pub deployment_configuration_type: BatchDeploymentConfigurationType, -} -impl BatchDeploymentConfiguration { - pub fn new(deployment_configuration_type: BatchDeploymentConfigurationType) -> Self { - Self { - deployment_configuration_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "deploymentConfigurationType")] -pub enum BatchDeploymentConfigurationUnion { - PipelineComponent(BatchPipelineComponentDeploymentConfiguration), -} -#[doc = "The enumerated property types for batch deployments."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BatchDeploymentConfigurationType")] -pub enum BatchDeploymentConfigurationType { - Model, - PipelineComponent, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BatchDeploymentConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BatchDeploymentConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BatchDeploymentConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Model => serializer.serialize_unit_variant("BatchDeploymentConfigurationType", 0u32, "Model"), - Self::PipelineComponent => serializer.serialize_unit_variant("BatchDeploymentConfigurationType", 1u32, "PipelineComponent"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BatchDeploymentTrackedResource { #[serde(flatten)] @@ -1694,35 +1223,6 @@ impl Serialize for BatchOutputAction { } } } -#[doc = "Properties for a Batch Pipeline Component Deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchPipelineComponentDeploymentConfiguration { - #[serde(flatten)] - pub batch_deployment_configuration: BatchDeploymentConfiguration, - #[doc = "Reference to an asset via its ARM resource ID."] - #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] - pub component_id: Option, - #[doc = "The description which will be applied to the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Run-time settings for the pipeline job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option, - #[doc = "The tags which will be applied to the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl BatchPipelineComponentDeploymentConfiguration { - pub fn new(batch_deployment_configuration: BatchDeploymentConfiguration) -> Self { - Self { - batch_deployment_configuration, - component_id: None, - description: None, - settings: None, - tags: None, - } - } -} #[doc = "Retry settings for a batch inference operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BatchRetrySettings { @@ -1749,76 +1249,6 @@ impl BayesianSamplingAlgorithm { Self { sampling_algorithm } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BindOptions { - #[doc = "Type of Bind Option"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub propagation: Option, - #[doc = "Indicate whether to create host path."] - #[serde(rename = "createHostPath", default, skip_serializing_if = "Option::is_none")] - pub create_host_path: Option, - #[doc = "Mention the selinux options."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selinux: Option, -} -impl BindOptions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum for all classification models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BlockedTransformers")] -pub enum BlockedTransformers { - TextTargetEncoder, - OneHotEncoder, - CatTargetEncoder, - TfIdf, - WoETargetEncoder, - LabelEncoder, - WordEmbedding, - NaiveBayes, - CountVectorizer, - HashOneHotEncoder, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BlockedTransformers { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BlockedTransformers { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BlockedTransformers { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::TextTargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 0u32, "TextTargetEncoder"), - Self::OneHotEncoder => serializer.serialize_unit_variant("BlockedTransformers", 1u32, "OneHotEncoder"), - Self::CatTargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 2u32, "CatTargetEncoder"), - Self::TfIdf => serializer.serialize_unit_variant("BlockedTransformers", 3u32, "TfIdf"), - Self::WoETargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 4u32, "WoETargetEncoder"), - Self::LabelEncoder => serializer.serialize_unit_variant("BlockedTransformers", 5u32, "LabelEncoder"), - Self::WordEmbedding => serializer.serialize_unit_variant("BlockedTransformers", 6u32, "WordEmbedding"), - Self::NaiveBayes => serializer.serialize_unit_variant("BlockedTransformers", 7u32, "NaiveBayes"), - Self::CountVectorizer => serializer.serialize_unit_variant("BlockedTransformers", 8u32, "CountVectorizer"), - Self::HashOneHotEncoder => serializer.serialize_unit_variant("BlockedTransformers", 9u32, "HashOneHotEncoder"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Configuration settings for Docker build context"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildContext { @@ -1895,225 +1325,6 @@ impl CertificateDatastoreSecrets { } } } -#[doc = "Classification task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Classification { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Positive label for binary metrics calculation."] - #[serde(rename = "positiveLabel", default, skip_serializing_if = "Option::is_none")] - pub positive_label: Option, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Classification Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Classification { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - positive_label: None, - primary_metric: None, - training_settings: None, - } - } -} -#[doc = "Enum for all classification models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationModels")] -pub enum ClassificationModels { - LogisticRegression, - #[serde(rename = "SGD")] - Sgd, - MultinomialNaiveBayes, - BernoulliNaiveBayes, - #[serde(rename = "SVM")] - Svm, - #[serde(rename = "LinearSVM")] - LinearSvm, - #[serde(rename = "KNN")] - Knn, - DecisionTree, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - GradientBoosting, - #[serde(rename = "XGBoostClassifier")] - XgBoostClassifier, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationModels { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationModels { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationModels { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::LogisticRegression => serializer.serialize_unit_variant("ClassificationModels", 0u32, "LogisticRegression"), - Self::Sgd => serializer.serialize_unit_variant("ClassificationModels", 1u32, "SGD"), - Self::MultinomialNaiveBayes => serializer.serialize_unit_variant("ClassificationModels", 2u32, "MultinomialNaiveBayes"), - Self::BernoulliNaiveBayes => serializer.serialize_unit_variant("ClassificationModels", 3u32, "BernoulliNaiveBayes"), - Self::Svm => serializer.serialize_unit_variant("ClassificationModels", 4u32, "SVM"), - Self::LinearSvm => serializer.serialize_unit_variant("ClassificationModels", 5u32, "LinearSVM"), - Self::Knn => serializer.serialize_unit_variant("ClassificationModels", 6u32, "KNN"), - Self::DecisionTree => serializer.serialize_unit_variant("ClassificationModels", 7u32, "DecisionTree"), - Self::RandomForest => serializer.serialize_unit_variant("ClassificationModels", 8u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("ClassificationModels", 9u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("ClassificationModels", 10u32, "LightGBM"), - Self::GradientBoosting => serializer.serialize_unit_variant("ClassificationModels", 11u32, "GradientBoosting"), - Self::XgBoostClassifier => serializer.serialize_unit_variant("ClassificationModels", 12u32, "XGBoostClassifier"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for classification multilabel tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationMultilabelPrimaryMetrics")] -pub enum ClassificationMultilabelPrimaryMetrics { - #[serde(rename = "AUCWeighted")] - AucWeighted, - Accuracy, - NormMacroRecall, - AveragePrecisionScoreWeighted, - PrecisionScoreWeighted, - #[serde(rename = "IOU")] - Iou, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationMultilabelPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationMultilabelPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationMultilabelPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AucWeighted => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 0u32, "AUCWeighted"), - Self::Accuracy => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 1u32, "Accuracy"), - Self::NormMacroRecall => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 2u32, "NormMacroRecall"), - Self::AveragePrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 3u32, "AveragePrecisionScoreWeighted") - } - Self::PrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 4u32, "PrecisionScoreWeighted") - } - Self::Iou => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 5u32, "IOU"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for classification tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationPrimaryMetrics")] -pub enum ClassificationPrimaryMetrics { - #[serde(rename = "AUCWeighted")] - AucWeighted, - Accuracy, - NormMacroRecall, - AveragePrecisionScoreWeighted, - PrecisionScoreWeighted, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AucWeighted => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 0u32, "AUCWeighted"), - Self::Accuracy => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 1u32, "Accuracy"), - Self::NormMacroRecall => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 2u32, "NormMacroRecall"), - Self::AveragePrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 3u32, "AveragePrecisionScoreWeighted") - } - Self::PrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 4u32, "PrecisionScoreWeighted") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Classification Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClassificationTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for classification task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for classification task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl ClassificationTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} #[doc = "AmlCompute update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ClusterUpdateParameters { @@ -2138,26 +1349,6 @@ impl ClusterUpdateProperties { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CocoExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CocoExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} #[doc = "Configuration for a scoring code asset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CodeConfiguration { @@ -2181,9 +1372,6 @@ impl CodeConfiguration { pub struct CodeContainer { #[serde(flatten)] pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl CodeContainer { pub fn new() -> Self { @@ -2239,9 +1427,6 @@ pub struct CodeVersion { #[doc = "Uri where code is located"] #[serde(rename = "codeUri", default, skip_serializing_if = "Option::is_none")] pub code_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl CodeVersion { pub fn new() -> Self { @@ -2289,33 +1474,11 @@ impl CodeVersionResourceArmPaginatedResult { Self::default() } } -#[doc = "Column transformer parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ColumnTransformer { - #[doc = "Fields to apply transformer logic on."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub fields: Vec, - #[doc = "Different properties to be passed to transformer.\r\nInput expected is dictionary of key,value pairs in JSON format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, -} -impl ColumnTransformer { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Command job definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommandJob { #[serde(flatten)] pub job_base: JobBase, - #[doc = "Settings for Autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, #[doc = "ARM resource ID of the code asset."] #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] pub code_id: Option, @@ -2342,16 +1505,13 @@ pub struct CommandJob { #[doc = "Input parameters."] #[serde(default, skip_serializing_if = "Option::is_none")] pub parameters: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, + pub resources: Option, } impl CommandJob { pub fn new(job_base: JobBase, command: String, environment_id: String) -> Self { Self { job_base, - autologger_settings: None, code_id: None, command, distribution: None, @@ -2361,7 +1521,6 @@ impl CommandJob { limits: None, outputs: None, parameters: None, - queue_settings: None, resources: None, } } @@ -2382,9 +1541,6 @@ impl CommandJobLimits { pub struct ComponentContainer { #[serde(flatten)] pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl ComponentContainer { pub fn new() -> Self { @@ -2440,9 +1596,6 @@ pub struct ComponentVersion { #[doc = "Defines Component definition details.\r\n"] #[serde(rename = "componentSpec", default, skip_serializing_if = "Option::is_none")] pub component_spec: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl ComponentVersion { pub fn new() -> Self { @@ -2642,58 +1795,6 @@ impl ComputeInstanceApplication { Self::default() } } -#[doc = "Specifies settings for autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceAutologgerSettings { - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[serde(rename = "mlflowAutologger", default, skip_serializing_if = "Option::is_none")] - pub mlflow_autologger: Option, -} -impl ComputeInstanceAutologgerSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_autologger_settings { - use super::*; - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MlflowAutologger")] - pub enum MlflowAutologger { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MlflowAutologger { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MlflowAutologger { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MlflowAutologger { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlflowAutologger", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlflowAutologger", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ComputeInstanceConnectivityEndpoints { @@ -3289,23 +2390,9 @@ pub struct ComputeInstanceProperties { #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] #[serde(rename = "applicationSharingPolicy", default, skip_serializing_if = "Option::is_none")] pub application_sharing_policy: Option, - #[doc = "Specifies settings for autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, #[doc = "Specifies policy and settings for SSH access."] #[serde(rename = "sshSettings", default, skip_serializing_if = "Option::is_none")] pub ssh_settings: Option, - #[doc = "List of Custom Services added to the compute."] - #[serde( - rename = "customServices", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub custom_services: Vec, - #[doc = "Returns metadata about the operating system image for this compute instance."] - #[serde(rename = "osImageMetadata", default, skip_serializing_if = "Option::is_none")] - pub os_image_metadata: Option, #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] #[serde(rename = "connectivityEndpoints", default, skip_serializing_if = "Option::is_none")] pub connectivity_endpoints: Option, @@ -3344,9 +2431,6 @@ pub struct ComputeInstanceProperties { #[doc = "The list of schedules to be applied on the computes"] #[serde(default, skip_serializing_if = "Option::is_none")] pub schedules: Option, - #[doc = "Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] pub enable_node_public_ip: Option, @@ -3621,7 +2705,7 @@ impl ComputeInstanceVersion { Self::default() } } -#[doc = "[Required] The compute power action."] +#[doc = "The compute power action."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ComputePowerAction")] pub enum ComputePowerAction { @@ -3694,16 +2778,6 @@ impl ComputeResourceSchema { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeRuntimeDto { - #[serde(rename = "sparkRuntimeVersion", default, skip_serializing_if = "Option::is_none")] - pub spark_runtime_version: Option, -} -impl ComputeRuntimeDto { - pub fn new() -> Self { - Self::default() - } -} #[doc = "The list of schedules to be applied on the computes"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ComputeSchedules { @@ -3744,24 +2818,15 @@ pub enum ComputeSecretsUnion { #[doc = "Compute start stop schedule properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ComputeStartStopSchedule { - #[doc = "A system assigned id for the schedule."] + #[doc = "Schedule id."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[doc = "The current deployment state of schedule."] #[serde(rename = "provisioningStatus", default, skip_serializing_if = "Option::is_none")] pub provisioning_status: Option, - #[doc = "Is the schedule enabled or disabled?"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "[Required] The compute power action."] + #[doc = "The compute power action."] #[serde(default, skip_serializing_if = "Option::is_none")] pub action: Option, - #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] - pub trigger_type: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub recurrence: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cron: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub schedule: Option, } @@ -3878,8 +2943,6 @@ pub enum ConnectionAuthType { None, #[serde(rename = "SAS")] Sas, - ServicePrincipal, - AccessKey, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3910,8 +2973,6 @@ impl Serialize for ConnectionAuthType { Self::UsernamePassword => serializer.serialize_unit_variant("ConnectionAuthType", 2u32, "UsernamePassword"), Self::None => serializer.serialize_unit_variant("ConnectionAuthType", 3u32, "None"), Self::Sas => serializer.serialize_unit_variant("ConnectionAuthType", 4u32, "SAS"), - Self::ServicePrincipal => serializer.serialize_unit_variant("ConnectionAuthType", 5u32, "ServicePrincipal"), - Self::AccessKey => serializer.serialize_unit_variant("ConnectionAuthType", 6u32, "AccessKey"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -3923,15 +2984,6 @@ pub enum ConnectionCategory { PythonFeed, ContainerRegistry, Git, - FeatureStore, - S3, - Snowflake, - AzureSqlDb, - AzureSynapseAnalytics, - AzureMySqlDb, - AzurePostgresDb, - AzureDataLakeGen2, - Redis, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3960,15 +3012,6 @@ impl Serialize for ConnectionCategory { Self::PythonFeed => serializer.serialize_unit_variant("ConnectionCategory", 0u32, "PythonFeed"), Self::ContainerRegistry => serializer.serialize_unit_variant("ConnectionCategory", 1u32, "ContainerRegistry"), Self::Git => serializer.serialize_unit_variant("ConnectionCategory", 2u32, "Git"), - Self::FeatureStore => serializer.serialize_unit_variant("ConnectionCategory", 3u32, "FeatureStore"), - Self::S3 => serializer.serialize_unit_variant("ConnectionCategory", 4u32, "S3"), - Self::Snowflake => serializer.serialize_unit_variant("ConnectionCategory", 5u32, "Snowflake"), - Self::AzureSqlDb => serializer.serialize_unit_variant("ConnectionCategory", 6u32, "AzureSqlDb"), - Self::AzureSynapseAnalytics => serializer.serialize_unit_variant("ConnectionCategory", 7u32, "AzureSynapseAnalytics"), - Self::AzureMySqlDb => serializer.serialize_unit_variant("ConnectionCategory", 8u32, "AzureMySqlDb"), - Self::AzurePostgresDb => serializer.serialize_unit_variant("ConnectionCategory", 9u32, "AzurePostgresDb"), - Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("ConnectionCategory", 10u32, "AzureDataLakeGen2"), - Self::Redis => serializer.serialize_unit_variant("ConnectionCategory", 11u32, "Redis"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -4003,13 +3046,11 @@ impl ContainerResourceSettings { Self::default() } } -#[doc = "The type of container to retrieve logs from."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ContainerType")] pub enum ContainerType { StorageInitializer, InferenceServer, - ModelDataCollector, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4037,7 +3078,6 @@ impl Serialize for ContainerType { match self { Self::StorageInitializer => serializer.serialize_unit_variant("ContainerType", 0u32, "StorageInitializer"), Self::InferenceServer => serializer.serialize_unit_variant("ContainerType", 1u32, "InferenceServer"), - Self::ModelDataCollector => serializer.serialize_unit_variant("ContainerType", 2u32, "ModelDataCollector"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -4062,8 +3102,6 @@ pub enum CredentialsType { None, Sas, ServicePrincipal, - KerberosKeytab, - KerberosPassword, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4094,91 +3132,27 @@ impl Serialize for CredentialsType { Self::None => serializer.serialize_unit_variant("CredentialsType", 2u32, "None"), Self::Sas => serializer.serialize_unit_variant("CredentialsType", 3u32, "Sas"), Self::ServicePrincipal => serializer.serialize_unit_variant("CredentialsType", 4u32, "ServicePrincipal"), - Self::KerberosKeytab => serializer.serialize_unit_variant("CredentialsType", 5u32, "KerberosKeytab"), - Self::KerberosPassword => serializer.serialize_unit_variant("CredentialsType", 6u32, "KerberosPassword"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CronTrigger { +pub struct CustomModelJobInput { #[serde(flatten)] - pub trigger_base: TriggerBase, - #[doc = "[Required] Specifies cron expression of schedule.\r\nThe expression should follow NCronTab format."] - pub expression: String, -} -impl CronTrigger { - pub fn new(trigger_base: TriggerBase, expression: String) -> Self { - Self { trigger_base, expression } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CsvExportSummary { + pub asset_job_input: AssetJobInput, #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, + pub job_input: JobInput, } -impl CsvExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { +impl CustomModelJobInput { + pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { Self { - export_summary, - container_name: None, - snapshot_path: None, + asset_job_input, + job_input, } } } -#[doc = "The desired maximum forecast horizon in units of time-series frequency."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomForecastHorizon { - #[serde(flatten)] - pub forecast_horizon: ForecastHorizon, - #[doc = "[Required] Forecast horizon value."] - pub value: i32, -} -impl CustomForecastHorizon { - pub fn new(forecast_horizon: ForecastHorizon, value: i32) -> Self { - Self { forecast_horizon, value } - } -} -#[doc = "Custom inference server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Online inference configuration options."] - #[serde(rename = "inferenceConfiguration", default, skip_serializing_if = "Option::is_none")] - pub inference_configuration: Option, -} -impl CustomInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - inference_configuration: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl CustomModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomModelJobOutput { +pub struct CustomModelJobOutput { #[serde(flatten)] pub asset_job_output: AssetJobOutput, #[serde(flatten)] @@ -4192,94 +3166,6 @@ impl CustomModelJobOutput { } } } -#[doc = "N-Cross validations are specified by user."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomNCrossValidations { - #[serde(flatten)] - pub n_cross_validations: NCrossValidations, - #[doc = "[Required] N-Cross validations value."] - pub value: i32, -} -impl CustomNCrossValidations { - pub fn new(n_cross_validations: NCrossValidations, value: i32) -> Self { - Self { - n_cross_validations, - value, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomSeasonality { - #[serde(flatten)] - pub seasonality: Seasonality, - #[doc = "[Required] Seasonality value."] - pub value: i32, -} -impl CustomSeasonality { - pub fn new(seasonality: Seasonality, value: i32) -> Self { - Self { seasonality, value } - } -} -#[doc = "Specifies the custom service configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CustomService { - #[doc = "Name of the Custom Service"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[doc = "Environment Variable for the container"] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub docker: Option, - #[doc = "Configuring the endpoints for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoints: Vec, - #[doc = "Configuring the volumes for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub volumes: Vec, -} -impl CustomService { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomTargetLags { - #[serde(flatten)] - pub target_lags: TargetLags, - #[doc = "[Required] Set target lags values."] - pub values: Vec, -} -impl CustomTargetLags { - pub fn new(target_lags: TargetLags, values: Vec) -> Self { - Self { target_lags, values } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomTargetRollingWindowSize { - #[serde(flatten)] - pub target_rolling_window_size: TargetRollingWindowSize, - #[doc = "[Required] TargetRollingWindowSize value."] - pub value: i32, -} -impl CustomTargetRollingWindowSize { - pub fn new(target_rolling_window_size: TargetRollingWindowSize, value: i32) -> Self { - Self { - target_rolling_window_size, - value, - } - } -} #[doc = "Container for data asset versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataContainer { @@ -4460,7 +3346,7 @@ pub struct DataVersionBase { #[doc = "Enum to determine the type of data."] #[serde(rename = "dataType")] pub data_type: DataType, - #[doc = "[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330"] + #[doc = "[Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType"] #[serde(rename = "dataUri")] pub data_uri: String, } @@ -4594,22 +3480,6 @@ impl DatabricksSchema { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The unique name of the labeled data asset."] - #[serde(rename = "labeledAssetName", default, skip_serializing_if = "Option::is_none")] - pub labeled_asset_name: Option, -} -impl DatasetExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - labeled_asset_name: None, - } - } -} #[doc = "Base definition for datastore contents configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datastore { @@ -4641,7 +3511,6 @@ pub enum DatastoreUnion { AzureDataLakeGen1(AzureDataLakeGen1Datastore), AzureDataLakeGen2(AzureDataLakeGen2Datastore), AzureFile(AzureFileDatastore), - Hdfs(HdfsDatastore), } #[doc = "Base definition for datastore credentials."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -4660,8 +3529,6 @@ impl DatastoreCredentials { pub enum DatastoreCredentialsUnion { AccountKey(AccountKeyDatastoreCredentials), Certificate(CertificateDatastoreCredentials), - KerberosKeytab(KerberosKeytabCredentials), - KerberosPassword(KerberosPasswordCredentials), None(NoneDatastoreCredentials), Sas(SasDatastoreCredentials), ServicePrincipal(ServicePrincipalDatastoreCredentials), @@ -4724,8 +3591,6 @@ impl DatastoreSecrets { pub enum DatastoreSecretsUnion { AccountKey(AccountKeyDatastoreSecrets), Certificate(CertificateDatastoreSecrets), - KerberosKeytab(KerberosKeytabSecrets), - KerberosPassword(KerberosPasswordSecrets), Sas(SasDatastoreSecrets), ServicePrincipal(ServicePrincipalDatastoreSecrets), } @@ -4737,7 +3602,6 @@ pub enum DatastoreType { AzureDataLakeGen1, AzureDataLakeGen2, AzureFile, - Hdfs, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4767,7 +3631,6 @@ impl Serialize for DatastoreType { Self::AzureDataLakeGen1 => serializer.serialize_unit_variant("DatastoreType", 1u32, "AzureDataLakeGen1"), Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("DatastoreType", 2u32, "AzureDataLakeGen2"), Self::AzureFile => serializer.serialize_unit_variant("DatastoreType", 3u32, "AzureFile"), - Self::Hdfs => serializer.serialize_unit_variant("DatastoreType", 4u32, "Hdfs"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -4795,7 +3658,6 @@ impl DeploymentLogs { } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentLogsRequest { - #[doc = "The type of container to retrieve logs from."] #[serde(rename = "containerType", default, skip_serializing_if = "Option::is_none")] pub container_type: Option, #[doc = "The maximum number of lines to tail."] @@ -4855,16 +3717,6 @@ impl Serialize for DeploymentProvisioningState { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeploymentResourceConfiguration { - #[serde(flatten)] - pub resource_configuration: ResourceConfiguration, -} -impl DeploymentResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiagnoseRequestProperties { #[doc = "Setting for diagnosing user defined routing"] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -5112,17 +3964,6 @@ impl Serialize for DistributionType { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Docker { - #[doc = "Indicate whether container shall run in privileged or non-privileged mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub privileged: Option, -} -impl Docker { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EarlyTerminationPolicy { @@ -5189,82 +4030,6 @@ impl Serialize for EarlyTerminationPolicyType { } } } -#[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EgressPublicNetworkAccessType")] -pub enum EgressPublicNetworkAccessType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EgressPublicNetworkAccessType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EgressPublicNetworkAccessType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EgressPublicNetworkAccessType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("EgressPublicNetworkAccessType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("EgressPublicNetworkAccessType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the email notification type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EmailNotificationEnableType")] -pub enum EmailNotificationEnableType { - JobCompleted, - JobFailed, - JobCancelled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EmailNotificationEnableType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EmailNotificationEnableType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EmailNotificationEnableType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JobCompleted => serializer.serialize_unit_variant("EmailNotificationEnableType", 0u32, "JobCompleted"), - Self::JobFailed => serializer.serialize_unit_variant("EmailNotificationEnableType", 1u32, "JobFailed"), - Self::JobCancelled => serializer.serialize_unit_variant("EmailNotificationEnableType", 2u32, "JobCancelled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EncryptionKeyVaultProperties { #[doc = "The ArmId of the keyVault where the customer owned encryption key is present."] @@ -5287,17 +4052,6 @@ impl EncryptionKeyVaultProperties { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionKeyVaultUpdateProperties { - #[doc = "Key Vault uri to access the encryption key."] - #[serde(rename = "keyIdentifier")] - pub key_identifier: String, -} -impl EncryptionKeyVaultUpdateProperties { - pub fn new(key_identifier: String) -> Self { - Self { key_identifier } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EncryptionProperty { #[doc = "Indicates whether or not the encryption is enabled for the workspace."] pub status: encryption_property::Status, @@ -5356,89 +4110,6 @@ pub mod encryption_property { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionUpdateProperties { - #[serde(rename = "keyVaultProperties")] - pub key_vault_properties: EncryptionKeyVaultUpdateProperties, -} -impl EncryptionUpdateProperties { - pub fn new(key_vault_properties: EncryptionKeyVaultUpdateProperties) -> Self { - Self { key_vault_properties } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Endpoint { - #[doc = "Protocol over which communication will happen over this endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[doc = "Name of the Endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Application port inside the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Port over which the application is exposed from container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub published: Option, - #[doc = "Host IP over which the application is exposed from the container"] - #[serde(rename = "hostIp", default, skip_serializing_if = "Option::is_none")] - pub host_ip: Option, -} -impl Endpoint { - pub fn new() -> Self { - Self::default() - } -} -pub mod endpoint { - use super::*; - #[doc = "Protocol over which communication will happen over this endpoint"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Protocol")] - pub enum Protocol { - #[serde(rename = "tcp")] - Tcp, - #[serde(rename = "udp")] - Udp, - #[serde(rename = "http")] - Http, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Protocol { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Protocol { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Protocol { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "tcp"), - Self::Udp => serializer.serialize_unit_variant("Protocol", 1u32, "udp"), - Self::Http => serializer.serialize_unit_variant("Protocol", 2u32, "http"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Protocol { - fn default() -> Self { - Self::Tcp - } - } -} #[doc = "Keys for endpoint authentication."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointAuthKeys { @@ -5565,7 +4236,7 @@ pub struct EndpointDeploymentPropertiesBase { #[doc = "Description of the endpoint deployment."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, - #[doc = "ARM resource ID of the environment specification for the endpoint deployment."] + #[doc = "ARM resource ID or AssetId of the environment specification for the endpoint deployment."] #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] pub environment_id: Option, #[doc = "Environment variables configuration for the deployment."] @@ -5659,30 +4330,11 @@ impl Serialize for EndpointProvisioningState { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointScheduleAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[doc = "[Required] Defines Schedule action definition details.\r\n"] - #[serde(rename = "endpointInvocationDefinition")] - pub endpoint_invocation_definition: serde_json::Value, -} -impl EndpointScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, endpoint_invocation_definition: serde_json::Value) -> Self { - Self { - schedule_action_base, - endpoint_invocation_definition, - } - } -} #[doc = "Container for environment specification versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentContainer { #[serde(flatten)] pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl EnvironmentContainer { pub fn new() -> Self { @@ -5767,72 +4419,11 @@ impl Serialize for EnvironmentType { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVariable { - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Value of the Environment variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl EnvironmentVariable { - pub fn new() -> Self { - Self::default() - } -} -pub mod environment_variable { - use super::*; - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "local")] - Local, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Local => serializer.serialize_unit_variant("Type", 0u32, "local"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Local - } - } -} #[doc = "Environment version details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentVersion { #[serde(flatten)] pub asset_base: AssetBase, - #[doc = "AutoRebuild setting for the derived image"] - #[serde(rename = "autoRebuild", default, skip_serializing_if = "Option::is_none")] - pub auto_rebuild: Option, #[doc = "Configuration settings for Docker build context"] #[serde(default, skip_serializing_if = "Option::is_none")] pub build: Option, @@ -5850,9 +4441,6 @@ pub struct EnvironmentVersion { #[doc = "The type of operating system."] #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] pub os_type: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl EnvironmentVersion { pub fn new() -> Self { @@ -6166,82 +4754,6 @@ pub mod estimated_vm_prices { } } } -#[doc = "The format of exported labels."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ExportFormatType")] -pub enum ExportFormatType { - Dataset, - Coco, - #[serde(rename = "CSV")] - Csv, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ExportFormatType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ExportFormatType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ExportFormatType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dataset => serializer.serialize_unit_variant("ExportFormatType", 0u32, "Dataset"), - Self::Coco => serializer.serialize_unit_variant("ExportFormatType", 1u32, "Coco"), - Self::Csv => serializer.serialize_unit_variant("ExportFormatType", 2u32, "CSV"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportSummary { - #[doc = "The time when the export was completed."] - #[serde(rename = "endDateTime", default, with = "azure_core::date::rfc3339::option")] - pub end_date_time: Option, - #[doc = "The total number of labeled datapoints exported."] - #[serde(rename = "exportedRowCount", default, skip_serializing_if = "Option::is_none")] - pub exported_row_count: Option, - #[doc = "The format of exported labels."] - pub format: ExportFormatType, - #[doc = "Name and identifier of the job containing exported labels."] - #[serde(rename = "labelingJobId", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_id: Option, - #[doc = "The time when the export was requested."] - #[serde(rename = "startDateTime", default, with = "azure_core::date::rfc3339::option")] - pub start_date_time: Option, -} -impl ExportSummary { - pub fn new(format: ExportFormatType) -> Self { - Self { - end_date_time: None, - exported_row_count: None, - format, - labeling_job_id: None, - start_date_time: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "format")] -pub enum ExportSummaryUnion { - Coco(CocoExportSummary), - #[serde(rename = "CSV")] - Csv(CsvExportSummary), - Dataset(DatasetExportSummary), -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalFqdnResponse { #[serde( @@ -6309,72 +4821,33 @@ impl FqdnEndpointsProperties { Self::default() } } -#[doc = "Dto object representing feature"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Feature { - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option, - #[doc = "Specifies description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Specifies name"] - #[serde(rename = "featureName", default, skip_serializing_if = "Option::is_none")] - pub feature_name: Option, - #[doc = "Specifies tags"] +pub struct FlavorData { + #[doc = "Model flavor-specific data."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl Feature { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A paginated list of Feature entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureArmPaginatedResult { - #[doc = "The link to the next page of Feature objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Feature."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeatureArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } + pub data: Option, } -impl FeatureArmPaginatedResult { +impl FlavorData { pub fn new() -> Self { Self::default() } } +#[doc = "Defines supported metric goals for hyperparameter tuning"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureDataType")] -pub enum FeatureDataType { - String, - Integer, - Long, - Float, - Double, - Binary, - Datetime, - Boolean, +#[serde(remote = "Goal")] +pub enum Goal { + Minimize, + Maximize, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for FeatureDataType { +impl FromStr for Goal { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for FeatureDataType { +impl<'de> Deserialize<'de> for Goal { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6384,40 +4857,129 @@ impl<'de> Deserialize<'de> for FeatureDataType { Ok(deserialized) } } -impl Serialize for FeatureDataType { +impl Serialize for Goal { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::String => serializer.serialize_unit_variant("FeatureDataType", 0u32, "String"), - Self::Integer => serializer.serialize_unit_variant("FeatureDataType", 1u32, "Integer"), - Self::Long => serializer.serialize_unit_variant("FeatureDataType", 2u32, "Long"), - Self::Float => serializer.serialize_unit_variant("FeatureDataType", 3u32, "Float"), - Self::Double => serializer.serialize_unit_variant("FeatureDataType", 4u32, "Double"), - Self::Binary => serializer.serialize_unit_variant("FeatureDataType", 5u32, "Binary"), - Self::Datetime => serializer.serialize_unit_variant("FeatureDataType", 6u32, "Datetime"), - Self::Boolean => serializer.serialize_unit_variant("FeatureDataType", 7u32, "Boolean"), + Self::Minimize => serializer.serialize_unit_variant("Goal", 0u32, "Minimize"), + Self::Maximize => serializer.serialize_unit_variant("Goal", 1u32, "Maximize"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Flag for generating lags for the numeric features."] +#[doc = "Defines a Sampling Algorithm that exhaustively generates every value combination in the space"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureLags")] -pub enum FeatureLags { - None, - Auto, +pub struct GridSamplingAlgorithm { + #[serde(flatten)] + pub sampling_algorithm: SamplingAlgorithm, +} +impl GridSamplingAlgorithm { + pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { + Self { sampling_algorithm } + } +} +#[doc = "A HDInsight compute."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HdInsight { + #[serde(flatten)] + pub compute: Compute, + #[serde(flatten)] + pub hd_insight_schema: HdInsightSchema, +} +impl HdInsight { + pub fn new(compute: Compute) -> Self { + Self { + compute, + hd_insight_schema: HdInsightSchema::default(), + } + } +} +#[doc = "HDInsight compute properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HdInsightProperties { + #[doc = "Port open for ssh connections on the master node of the cluster."] + #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] + pub ssh_port: Option, + #[doc = "Public IP address of the master node of the cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[doc = "Admin credentials for virtual machine"] + #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] + pub administrator_account: Option, +} +impl HdInsightProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HdInsightSchema { + #[doc = "HDInsight compute properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl HdInsightSchema { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Reference to an asset via its ARM resource ID."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IdAssetReference { + #[serde(flatten)] + pub asset_reference_base: AssetReferenceBase, + #[doc = "[Required] ARM resource ID of the asset."] + #[serde(rename = "assetId")] + pub asset_id: String, +} +impl IdAssetReference { + pub fn new(asset_reference_base: AssetReferenceBase, asset_id: String) -> Self { + Self { + asset_reference_base, + asset_id, + } + } +} +#[doc = "Base definition for identity configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IdentityConfiguration { + #[doc = "Enum to determine identity framework."] + #[serde(rename = "identityType")] + pub identity_type: IdentityConfigurationType, +} +impl IdentityConfiguration { + pub fn new(identity_type: IdentityConfigurationType) -> Self { + Self { identity_type } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "identityType")] +pub enum IdentityConfigurationUnion { + #[serde(rename = "AMLToken")] + AmlToken(AmlToken), + Managed(ManagedIdentity), + UserIdentity(UserIdentity), +} +#[doc = "Enum to determine identity framework."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "IdentityConfigurationType")] +pub enum IdentityConfigurationType { + Managed, + #[serde(rename = "AMLToken")] + AmlToken, + UserIdentity, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for FeatureLags { +impl FromStr for IdentityConfigurationType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for FeatureLags { +impl<'de> Deserialize<'de> for IdentityConfigurationType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6427,416 +4989,288 @@ impl<'de> Deserialize<'de> for FeatureLags { Ok(deserialized) } } -impl Serialize for FeatureLags { +impl Serialize for IdentityConfigurationType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::None => serializer.serialize_unit_variant("FeatureLags", 0u32, "None"), - Self::Auto => serializer.serialize_unit_variant("FeatureLags", 1u32, "Auto"), + Self::Managed => serializer.serialize_unit_variant("IdentityConfigurationType", 0u32, "Managed"), + Self::AmlToken => serializer.serialize_unit_variant("IdentityConfigurationType", 1u32, "AMLToken"), + Self::UserIdentity => serializer.serialize_unit_variant("IdentityConfigurationType", 2u32, "UserIdentity"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } +#[doc = "Identity that will be used to access key vault for encryption at rest"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureStoreSettings { - #[serde(rename = "computeRuntime", default, skip_serializing_if = "Option::is_none")] - pub compute_runtime: Option, - #[serde(rename = "offlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub offline_store_connection_name: Option, - #[serde(rename = "onlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub online_store_connection_name: Option, -} -impl FeatureStoreSettings { - pub fn new() -> Self { - Self::default() - } +pub struct IdentityForCmk { + #[doc = "The ArmId of the user assigned identity that will be used to access the customer managed key vault"] + #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identity: Option, } -#[doc = "Specifies the feature window"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureWindow { - #[doc = "Specifies the feature window end time"] - #[serde(rename = "featureWindowEnd", default, with = "azure_core::date::rfc3339::option")] - pub feature_window_end: Option, - #[doc = "Specifies the feature window start time"] - #[serde(rename = "featureWindowStart", default, with = "azure_core::date::rfc3339::option")] - pub feature_window_start: Option, -} -impl FeatureWindow { +impl IdentityForCmk { pub fn new() -> Self { Self::default() } } -#[doc = "Dto object representing feature set"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, +pub struct InferenceContainerProperties { + #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] + pub liveness_route: Option, + #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] + pub readiness_route: Option, + #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] + pub scoring_route: Option, } -impl FeaturesetContainer { +impl InferenceContainerProperties { pub fn new() -> Self { Self::default() } } -#[doc = "Azure Resource Manager resource envelope."] +#[doc = "Enum to determine the input data delivery mode."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturesetContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature set"] - pub properties: FeaturesetContainer, +#[serde(remote = "InputDeliveryMode")] +pub enum InputDeliveryMode { + ReadOnlyMount, + ReadWriteMount, + Download, + Direct, + EvalMount, + EvalDownload, + #[serde(skip_deserializing)] + UnknownValue(String), } -impl FeaturesetContainerResource { - pub fn new(properties: FeaturesetContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } +impl FromStr for InputDeliveryMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) } } -#[doc = "A paginated list of FeaturesetContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) +impl<'de> Deserialize<'de> for InputDeliveryMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) } } -impl FeaturesetContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() +impl Serialize for InputDeliveryMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ReadOnlyMount => serializer.serialize_unit_variant("InputDeliveryMode", 0u32, "ReadOnlyMount"), + Self::ReadWriteMount => serializer.serialize_unit_variant("InputDeliveryMode", 1u32, "ReadWriteMount"), + Self::Download => serializer.serialize_unit_variant("InputDeliveryMode", 2u32, "Download"), + Self::Direct => serializer.serialize_unit_variant("InputDeliveryMode", 3u32, "Direct"), + Self::EvalMount => serializer.serialize_unit_variant("InputDeliveryMode", 4u32, "EvalMount"), + Self::EvalDownload => serializer.serialize_unit_variant("InputDeliveryMode", 5u32, "EvalDownload"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } -#[doc = "Dto object representing the feature set job"] +#[doc = "Resource requests/limits for this instance type"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetJob { - #[doc = "Specifies the created date"] - #[serde(rename = "createdDate", default, with = "azure_core::date::rfc3339::option")] - pub created_date: Option, - #[doc = "Specifies the display name"] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Specifies the duration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option, - #[doc = "Specifies the experiment id"] - #[serde(rename = "experimentId", default, skip_serializing_if = "Option::is_none")] - pub experiment_id: Option, - #[doc = "Specifies the feature window"] - #[serde(rename = "featureWindow", default, skip_serializing_if = "Option::is_none")] - pub feature_window: Option, - #[doc = "Specifies the job id"] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "The status of a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Specifies the tags if any"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl FeaturesetJob { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A paginated list of FeaturesetJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetJobArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetJobArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetJobArmPaginatedResult { +pub struct InstanceResourceSchema {} +impl InstanceResourceSchema { pub fn new() -> Self { Self::default() } } -#[doc = "Dto object representing specification"] +#[doc = "Instance type schema."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetSpecification { - #[doc = "Specifies the spec path"] +pub struct InstanceTypeSchema { + #[doc = "Node Selector"] + #[serde(rename = "nodeSelector", default, skip_serializing_if = "Option::is_none")] + pub node_selector: Option, + #[doc = "Resource requests/limits for this instance type"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, + pub resources: Option, } -impl FeaturesetSpecification { +impl InstanceTypeSchema { pub fn new() -> Self { Self::default() } } -#[doc = "Dto object representing feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Specifies list of entities"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub entities: Vec, - #[serde(rename = "materializationSettings", default, skip_serializing_if = "Option::is_none")] - pub materialization_settings: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Dto object representing specification"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub specification: Option, - #[doc = "Specifies the asset stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl FeaturesetVersion { - pub fn new() -> Self { - Self::default() +pub mod instance_type_schema { + use super::*; + #[doc = "Resource requests/limits for this instance type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Resources { + #[doc = "Resource requests/limits for this instance type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub requests: Option, + #[doc = "Resource requests/limits for this instance type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limits: Option, + } + impl Resources { + pub fn new() -> Self { + Self::default() + } } } -#[doc = "Request payload for creating a backfill request for a given feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersionBackfillRequest { - #[doc = "Specifies description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Specifies description"] +#[doc = "Base definition for a job."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JobBase { + #[serde(flatten)] + pub resource_base: ResourceBase, + #[doc = "ARM resource ID of the compute resource."] + #[serde(rename = "computeId", default, skip_serializing_if = "Option::is_none")] + pub compute_id: Option, + #[doc = "Display name of job."] #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] pub display_name: Option, - #[doc = "Specifies the feature window"] - #[serde(rename = "featureWindow", default, skip_serializing_if = "Option::is_none")] - pub feature_window: Option, - #[doc = "Dto object representing compute resource"] + #[doc = "The name of the experiment the job belongs to. If not set, the job is placed in the \"Default\" experiment."] + #[serde(rename = "experimentName", default, skip_serializing_if = "Option::is_none")] + pub experiment_name: Option, + #[doc = "Base definition for identity configuration."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[doc = "Specifies the spark compute settings"] - #[serde(rename = "sparkConfiguration", default, skip_serializing_if = "Option::is_none")] - pub spark_configuration: Option, - #[doc = "Specifies the tags"] + pub identity: Option, + #[doc = "Is the asset archived?"] + #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] + pub is_archived: Option, + #[doc = "Enum to determine the type of job."] + #[serde(rename = "jobType")] + pub job_type: JobType, + #[doc = "List of JobEndpoints.\r\nFor local jobs, a job endpoint will have an endpoint value of FileStreamObject."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl FeaturesetVersionBackfillRequest { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Response payload for creating a backfill request for a given feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersionBackfillResponse { - #[doc = "Job id created as part of request"] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, -} -impl FeaturesetVersionBackfillResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturesetVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature set version"] - pub properties: FeaturesetVersion, + pub services: Option, + #[doc = "The status of a job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, } -impl FeaturesetVersionResource { - pub fn new(properties: FeaturesetVersion) -> Self { +impl JobBase { + pub fn new(job_type: JobType) -> Self { Self { - resource: Resource::default(), - properties, + resource_base: ResourceBase::default(), + compute_id: None, + display_name: None, + experiment_name: None, + identity: None, + is_archived: None, + job_type, + services: None, + status: None, } } } -#[doc = "A paginated list of FeaturesetVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl FeaturestoreEntityContainer { - pub fn new() -> Self { - Self::default() - } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobType")] +pub enum JobBaseUnion { + Command(CommandJob), + Pipeline(PipelineJob), + Sweep(SweepJob), } #[doc = "Azure Resource Manager resource envelope."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturestoreEntityContainerResource { +pub struct JobBaseResource { #[serde(flatten)] pub resource: Resource, - #[doc = "Dto object representing feature entity"] - pub properties: FeaturestoreEntityContainer, + #[doc = "Base definition for a job."] + pub properties: JobBaseUnion, } -impl FeaturestoreEntityContainerResource { - pub fn new(properties: FeaturestoreEntityContainer) -> Self { +impl JobBaseResource { + pub fn new(properties: JobBaseUnion) -> Self { Self { resource: Resource::default(), properties, } } } -#[doc = "A paginated list of FeaturestoreEntityContainer entities."] +#[doc = "A paginated list of JobBase entities."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturestoreEntityContainer objects. If null, there are no additional pages."] +pub struct JobBaseResourceArmPaginatedResult { + #[doc = "The link to the next page of JobBase objects. If null, there are no additional pages."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, - #[doc = "An array of objects of type FeaturestoreEntityContainer."] + #[doc = "An array of objects of type JobBase."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } -impl azure_core::Continuable for FeaturestoreEntityContainerResourceArmPaginatedResult { +impl azure_core::Continuable for JobBaseResourceArmPaginatedResult { type Continuation = String; fn continuation(&self) -> Option { self.next_link.clone().filter(|value| !value.is_empty()) } } -impl FeaturestoreEntityContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature entity version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Specifies index columns"] - #[serde( - rename = "indexColumns", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub index_columns: Vec, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl FeaturestoreEntityVersion { +impl JobBaseResourceArmPaginatedResult { pub fn new() -> Self { Self::default() } } -#[doc = "Azure Resource Manager resource envelope."] +#[doc = "Command job definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturestoreEntityVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature entity version"] - pub properties: FeaturestoreEntityVersion, +pub struct JobInput { + #[doc = "Description for the input."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Enum to determine the Job Input Type."] + #[serde(rename = "jobInputType")] + pub job_input_type: JobInputType, } -impl FeaturestoreEntityVersionResource { - pub fn new(properties: FeaturestoreEntityVersion) -> Self { +impl JobInput { + pub fn new(job_input_type: JobInputType) -> Self { Self { - resource: Resource::default(), - properties, + description: None, + job_input_type, } } } -#[doc = "A paginated list of FeaturestoreEntityVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturestoreEntityVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturestoreEntityVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturestoreEntityVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturestoreEntityVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobInputType")] +pub enum JobInputUnion { + #[serde(rename = "custom_model")] + CustomModel(CustomModelJobInput), + #[serde(rename = "literal")] + Literal(LiteralJobInput), + #[serde(rename = "mlflow_model")] + MlflowModel(MlFlowModelJobInput), + #[serde(rename = "mltable")] + Mltable(MlTableJobInput), + #[serde(rename = "triton_model")] + TritonModel(TritonModelJobInput), + #[serde(rename = "uri_file")] + UriFile(UriFileJobInput), + #[serde(rename = "uri_folder")] + UriFolder(UriFolderJobInput), } +#[doc = "Enum to determine the Job Input Type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeaturestoreJobType")] -pub enum FeaturestoreJobType { - RecurrentMaterialization, - BackfillMaterialization, +#[serde(remote = "JobInputType")] +pub enum JobInputType { + #[serde(rename = "literal")] + Literal, + #[serde(rename = "uri_file")] + UriFile, + #[serde(rename = "uri_folder")] + UriFolder, + #[serde(rename = "mltable")] + Mltable, + #[serde(rename = "custom_model")] + CustomModel, + #[serde(rename = "mlflow_model")] + MlflowModel, + #[serde(rename = "triton_model")] + TritonModel, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for FeaturestoreJobType { +impl FromStr for JobInputType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for FeaturestoreJobType { +impl<'de> Deserialize<'de> for JobInputType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6846,35 +5280,60 @@ impl<'de> Deserialize<'de> for FeaturestoreJobType { Ok(deserialized) } } -impl Serialize for FeaturestoreJobType { +impl Serialize for JobInputType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::RecurrentMaterialization => serializer.serialize_unit_variant("FeaturestoreJobType", 0u32, "RecurrentMaterialization"), - Self::BackfillMaterialization => serializer.serialize_unit_variant("FeaturestoreJobType", 1u32, "BackfillMaterialization"), + Self::Literal => serializer.serialize_unit_variant("JobInputType", 0u32, "literal"), + Self::UriFile => serializer.serialize_unit_variant("JobInputType", 1u32, "uri_file"), + Self::UriFolder => serializer.serialize_unit_variant("JobInputType", 2u32, "uri_folder"), + Self::Mltable => serializer.serialize_unit_variant("JobInputType", 3u32, "mltable"), + Self::CustomModel => serializer.serialize_unit_variant("JobInputType", 4u32, "custom_model"), + Self::MlflowModel => serializer.serialize_unit_variant("JobInputType", 5u32, "mlflow_model"), + Self::TritonModel => serializer.serialize_unit_variant("JobInputType", 6u32, "triton_model"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Featurization mode - determines data featurization mode."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeaturizationMode")] -pub enum FeaturizationMode { - Auto, - Custom, - Off, +pub struct JobLimits { + #[serde(rename = "jobLimitsType")] + pub job_limits_type: JobLimitsType, + #[doc = "The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, +} +impl JobLimits { + pub fn new(job_limits_type: JobLimitsType) -> Self { + Self { + job_limits_type, + timeout: None, + } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "jobLimitsType")] +pub enum JobLimitsUnion { + Command(CommandJobLimits), + Sweep(SweepJobLimits), +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "JobLimitsType")] +pub enum JobLimitsType { + Command, + Sweep, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for FeaturizationMode { +impl FromStr for JobLimitsType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for FeaturizationMode { +impl<'de> Deserialize<'de> for JobLimitsType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6884,75 +5343,78 @@ impl<'de> Deserialize<'de> for FeaturizationMode { Ok(deserialized) } } -impl Serialize for FeaturizationMode { +impl Serialize for JobLimitsType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Auto => serializer.serialize_unit_variant("FeaturizationMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("FeaturizationMode", 1u32, "Custom"), - Self::Off => serializer.serialize_unit_variant("FeaturizationMode", 2u32, "Off"), + Self::Command => serializer.serialize_unit_variant("JobLimitsType", 0u32, "Command"), + Self::Sweep => serializer.serialize_unit_variant("JobLimitsType", 1u32, "Sweep"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Featurization Configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturizationSettings { - #[doc = "Dataset language, useful for the text data."] - #[serde(rename = "datasetLanguage", default, skip_serializing_if = "Option::is_none")] - pub dataset_language: Option, -} -impl FeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FlavorData { - #[doc = "Model flavor-specific data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option, -} -impl FlavorData { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The desired maximum forecast horizon in units of time-series frequency."] +#[doc = "Job output definition container information on where to find job output/logs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ForecastHorizon { - #[doc = "Enum to determine forecast horizon selection mode."] - pub mode: ForecastHorizonMode, +pub struct JobOutput { + #[doc = "Description for the output."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Enum to determine the Job Output Type."] + #[serde(rename = "jobOutputType")] + pub job_output_type: JobOutputType, } -impl ForecastHorizon { - pub fn new(mode: ForecastHorizonMode) -> Self { - Self { mode } +impl JobOutput { + pub fn new(job_output_type: JobOutputType) -> Self { + Self { + description: None, + job_output_type, + } } } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum ForecastHorizonUnion { - Auto(AutoForecastHorizon), - Custom(CustomForecastHorizon), +#[serde(tag = "jobOutputType")] +pub enum JobOutputUnion { + #[serde(rename = "custom_model")] + CustomModel(CustomModelJobOutput), + #[serde(rename = "mlflow_model")] + MlflowModel(MlFlowModelJobOutput), + #[serde(rename = "mltable")] + Mltable(MlTableJobOutput), + #[serde(rename = "triton_model")] + TritonModel(TritonModelJobOutput), + #[serde(rename = "uri_file")] + UriFile(UriFileJobOutput), + #[serde(rename = "uri_folder")] + UriFolder(UriFolderJobOutput), } -#[doc = "Enum to determine forecast horizon selection mode."] +#[doc = "Enum to determine the Job Output Type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastHorizonMode")] -pub enum ForecastHorizonMode { - Auto, - Custom, +#[serde(remote = "JobOutputType")] +pub enum JobOutputType { + #[serde(rename = "uri_file")] + UriFile, + #[serde(rename = "uri_folder")] + UriFolder, + #[serde(rename = "mltable")] + Mltable, + #[serde(rename = "custom_model")] + CustomModel, + #[serde(rename = "mlflow_model")] + MlflowModel, + #[serde(rename = "triton_model")] + TritonModel, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for ForecastHorizonMode { +impl FromStr for JobOutputType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for ForecastHorizonMode { +impl<'de> Deserialize<'de> for JobOutputType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -6962,84 +5424,77 @@ impl<'de> Deserialize<'de> for ForecastHorizonMode { Ok(deserialized) } } -impl Serialize for ForecastHorizonMode { +impl Serialize for JobOutputType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Auto => serializer.serialize_unit_variant("ForecastHorizonMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("ForecastHorizonMode", 1u32, "Custom"), + Self::UriFile => serializer.serialize_unit_variant("JobOutputType", 0u32, "uri_file"), + Self::UriFolder => serializer.serialize_unit_variant("JobOutputType", 1u32, "uri_folder"), + Self::Mltable => serializer.serialize_unit_variant("JobOutputType", 2u32, "mltable"), + Self::CustomModel => serializer.serialize_unit_variant("JobOutputType", 3u32, "custom_model"), + Self::MlflowModel => serializer.serialize_unit_variant("JobOutputType", 4u32, "mlflow_model"), + Self::TritonModel => serializer.serialize_unit_variant("JobOutputType", 5u32, "triton_model"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Forecasting task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Forecasting { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Forecasting specific parameters."] - #[serde(rename = "forecastingSettings", default, skip_serializing_if = "Option::is_none")] - pub forecasting_settings: Option, - #[doc = "Primary metrics for Forecasting task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Forecasting Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Forecasting { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - forecasting_settings: None, - primary_metric: None, - training_settings: None, - } +#[doc = "Job endpoint definition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JobService { + #[doc = "Url for endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option, + #[doc = "Any error in the service."] + #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[doc = "Endpoint type."] + #[serde(rename = "jobServiceType", default, skip_serializing_if = "Option::is_none")] + pub job_service_type: Option, + #[doc = "Port for endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "Additional properties to set on the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Status of endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl JobService { + pub fn new() -> Self { + Self::default() } } -#[doc = "Enum for all forecasting models supported by AutoML."] +#[doc = "The status of a job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastingModels")] -pub enum ForecastingModels { - AutoArima, - Prophet, - Naive, - SeasonalNaive, - Average, - SeasonalAverage, - ExponentialSmoothing, - Arimax, - #[serde(rename = "TCNForecaster")] - TcnForecaster, - ElasticNet, - GradientBoosting, - DecisionTree, - #[serde(rename = "KNN")] - Knn, - LassoLars, - #[serde(rename = "SGD")] - Sgd, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - #[serde(rename = "XGBoostRegressor")] - XgBoostRegressor, +#[serde(remote = "JobStatus")] +pub enum JobStatus { + NotStarted, + Starting, + Provisioning, + Preparing, + Queued, + Running, + Finalizing, + CancelRequested, + Completed, + Failed, + Canceled, + NotResponding, + Paused, + Unknown, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for ForecastingModels { +impl FromStr for JobStatus { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for ForecastingModels { +impl<'de> Deserialize<'de> for JobStatus { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -7049,53 +5504,47 @@ impl<'de> Deserialize<'de> for ForecastingModels { Ok(deserialized) } } -impl Serialize for ForecastingModels { +impl Serialize for JobStatus { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::AutoArima => serializer.serialize_unit_variant("ForecastingModels", 0u32, "AutoArima"), - Self::Prophet => serializer.serialize_unit_variant("ForecastingModels", 1u32, "Prophet"), - Self::Naive => serializer.serialize_unit_variant("ForecastingModels", 2u32, "Naive"), - Self::SeasonalNaive => serializer.serialize_unit_variant("ForecastingModels", 3u32, "SeasonalNaive"), - Self::Average => serializer.serialize_unit_variant("ForecastingModels", 4u32, "Average"), - Self::SeasonalAverage => serializer.serialize_unit_variant("ForecastingModels", 5u32, "SeasonalAverage"), - Self::ExponentialSmoothing => serializer.serialize_unit_variant("ForecastingModels", 6u32, "ExponentialSmoothing"), - Self::Arimax => serializer.serialize_unit_variant("ForecastingModels", 7u32, "Arimax"), - Self::TcnForecaster => serializer.serialize_unit_variant("ForecastingModels", 8u32, "TCNForecaster"), - Self::ElasticNet => serializer.serialize_unit_variant("ForecastingModels", 9u32, "ElasticNet"), - Self::GradientBoosting => serializer.serialize_unit_variant("ForecastingModels", 10u32, "GradientBoosting"), - Self::DecisionTree => serializer.serialize_unit_variant("ForecastingModels", 11u32, "DecisionTree"), - Self::Knn => serializer.serialize_unit_variant("ForecastingModels", 12u32, "KNN"), - Self::LassoLars => serializer.serialize_unit_variant("ForecastingModels", 13u32, "LassoLars"), - Self::Sgd => serializer.serialize_unit_variant("ForecastingModels", 14u32, "SGD"), - Self::RandomForest => serializer.serialize_unit_variant("ForecastingModels", 15u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("ForecastingModels", 16u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("ForecastingModels", 17u32, "LightGBM"), - Self::XgBoostRegressor => serializer.serialize_unit_variant("ForecastingModels", 18u32, "XGBoostRegressor"), + Self::NotStarted => serializer.serialize_unit_variant("JobStatus", 0u32, "NotStarted"), + Self::Starting => serializer.serialize_unit_variant("JobStatus", 1u32, "Starting"), + Self::Provisioning => serializer.serialize_unit_variant("JobStatus", 2u32, "Provisioning"), + Self::Preparing => serializer.serialize_unit_variant("JobStatus", 3u32, "Preparing"), + Self::Queued => serializer.serialize_unit_variant("JobStatus", 4u32, "Queued"), + Self::Running => serializer.serialize_unit_variant("JobStatus", 5u32, "Running"), + Self::Finalizing => serializer.serialize_unit_variant("JobStatus", 6u32, "Finalizing"), + Self::CancelRequested => serializer.serialize_unit_variant("JobStatus", 7u32, "CancelRequested"), + Self::Completed => serializer.serialize_unit_variant("JobStatus", 8u32, "Completed"), + Self::Failed => serializer.serialize_unit_variant("JobStatus", 9u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("JobStatus", 10u32, "Canceled"), + Self::NotResponding => serializer.serialize_unit_variant("JobStatus", 11u32, "NotResponding"), + Self::Paused => serializer.serialize_unit_variant("JobStatus", 12u32, "Paused"), + Self::Unknown => serializer.serialize_unit_variant("JobStatus", 13u32, "Unknown"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Primary metrics for Forecasting task."] +#[doc = "Enum to determine the type of job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastingPrimaryMetrics")] -pub enum ForecastingPrimaryMetrics { - SpearmanCorrelation, - NormalizedRootMeanSquaredError, - R2Score, - NormalizedMeanAbsoluteError, +#[serde(remote = "JobType")] +pub enum JobType { + Command, + Sweep, + Pipeline, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for ForecastingPrimaryMetrics { +impl FromStr for JobType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for ForecastingPrimaryMetrics { +impl<'de> Deserialize<'de> for JobType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -7105,132 +5554,34 @@ impl<'de> Deserialize<'de> for ForecastingPrimaryMetrics { Ok(deserialized) } } -impl Serialize for ForecastingPrimaryMetrics { +impl Serialize for JobType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::SpearmanCorrelation => serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 0u32, "SpearmanCorrelation"), - Self::NormalizedRootMeanSquaredError => { - serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 1u32, "NormalizedRootMeanSquaredError") - } - Self::R2Score => serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 2u32, "R2Score"), - Self::NormalizedMeanAbsoluteError => { - serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 3u32, "NormalizedMeanAbsoluteError") - } + Self::Command => serializer.serialize_unit_variant("JobType", 0u32, "Command"), + Self::Sweep => serializer.serialize_unit_variant("JobType", 1u32, "Sweep"), + Self::Pipeline => serializer.serialize_unit_variant("JobType", 2u32, "Pipeline"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Forecasting specific parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastingSettings { - #[doc = "Country or region for holidays for forecasting tasks.\r\nThese should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'."] - #[serde(rename = "countryOrRegionForHolidays", default, skip_serializing_if = "Option::is_none")] - pub country_or_region_for_holidays: Option, - #[doc = "Number of periods between the origin time of one CV fold and the next fold. For\r\nexample, if `CVStepSize` = 3 for daily data, the origin time for each fold will be\r\nthree days apart."] - #[serde(rename = "cvStepSize", default, skip_serializing_if = "Option::is_none")] - pub cv_step_size: Option, - #[doc = "Flag for generating lags for the numeric features."] - #[serde(rename = "featureLags", default, skip_serializing_if = "Option::is_none")] - pub feature_lags: Option, - #[doc = "The desired maximum forecast horizon in units of time-series frequency."] - #[serde(rename = "forecastHorizon", default, skip_serializing_if = "Option::is_none")] - pub forecast_horizon: Option, - #[doc = "When forecasting, this parameter represents the period with which the forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency by default."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub frequency: Option, - #[doc = "Forecasting seasonality."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub seasonality: Option, - #[doc = "The parameter defining how if AutoML should handle short time series."] - #[serde(rename = "shortSeriesHandlingConfig", default, skip_serializing_if = "Option::is_none")] - pub short_series_handling_config: Option, - #[doc = "Target aggregate function."] - #[serde(rename = "targetAggregateFunction", default, skip_serializing_if = "Option::is_none")] - pub target_aggregate_function: Option, - #[doc = "The number of past periods to lag from the target column."] - #[serde(rename = "targetLags", default, skip_serializing_if = "Option::is_none")] - pub target_lags: Option, - #[doc = "Forecasting target rolling window size."] - #[serde(rename = "targetRollingWindowSize", default, skip_serializing_if = "Option::is_none")] - pub target_rolling_window_size: Option, - #[doc = "The name of the time column. This parameter is required when forecasting to specify the datetime column in the input data used for building the time series and inferring its frequency."] - #[serde(rename = "timeColumnName", default, skip_serializing_if = "Option::is_none")] - pub time_column_name: Option, - #[doc = "The names of columns used to group a timeseries. It can be used to create multiple series.\r\nIf grain is not defined, the data set is assumed to be one time-series. This parameter is used with task type forecasting."] - #[serde( - rename = "timeSeriesIdColumnNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub time_series_id_column_names: Vec, - #[doc = "Configure STL Decomposition of the time-series target column."] - #[serde(rename = "useStl", default, skip_serializing_if = "Option::is_none")] - pub use_stl: Option, -} -impl ForecastingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecasting Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastingTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for forecasting task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for forecasting task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl ForecastingTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Request payload to retrieve feature information from a given feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GetFeatureRequest { - #[doc = "Specifies name of the feature."] - #[serde(rename = "featureName", default, skip_serializing_if = "Option::is_none")] - pub feature_name: Option, -} -impl GetFeatureRequest { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines supported metric goals for hyperparameter tuning"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "Goal")] -pub enum Goal { - Minimize, - Maximize, +#[serde(remote = "KeyType")] +pub enum KeyType { + Primary, + Secondary, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for Goal { +impl FromStr for KeyType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for Goal { +impl<'de> Deserialize<'de> for KeyType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -7240,153 +5591,184 @@ impl<'de> Deserialize<'de> for Goal { Ok(deserialized) } } -impl Serialize for Goal { +impl Serialize for KeyType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Minimize => serializer.serialize_unit_variant("Goal", 0u32, "Minimize"), - Self::Maximize => serializer.serialize_unit_variant("Goal", 1u32, "Maximize"), + Self::Primary => serializer.serialize_unit_variant("KeyType", 0u32, "Primary"), + Self::Secondary => serializer.serialize_unit_variant("KeyType", 1u32, "Secondary"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Defines a Sampling Algorithm that exhaustively generates every value combination in the space"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GridSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, -} -impl GridSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { sampling_algorithm } - } -} -#[doc = "A HDInsight compute."] +#[doc = "A Machine Learning compute based on Kubernetes Compute."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdInsight { +pub struct Kubernetes { #[serde(flatten)] pub compute: Compute, #[serde(flatten)] - pub hd_insight_schema: HdInsightSchema, + pub kubernetes_schema: KubernetesSchema, } -impl HdInsight { +impl Kubernetes { pub fn new(compute: Compute) -> Self { Self { compute, - hd_insight_schema: HdInsightSchema::default(), + kubernetes_schema: KubernetesSchema::default(), } } } -#[doc = "HDInsight compute properties"] +#[doc = "Properties specific to a KubernetesOnlineDeployment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct KubernetesOnlineDeployment { + #[serde(flatten)] + pub online_deployment: OnlineDeployment, + #[doc = "Resource requirements for each container instance within an online deployment."] + #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] + pub container_resource_requirements: Option, +} +impl KubernetesOnlineDeployment { + pub fn new(online_deployment: OnlineDeployment) -> Self { + Self { + online_deployment, + container_resource_requirements: None, + } + } +} +#[doc = "Kubernetes properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HdInsightProperties { - #[doc = "Port open for ssh connections on the master node of the cluster."] - #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] - pub ssh_port: Option, - #[doc = "Public IP address of the master node of the cluster."] +pub struct KubernetesProperties { + #[doc = "Relay connection string."] + #[serde(rename = "relayConnectionString", default, skip_serializing_if = "Option::is_none")] + pub relay_connection_string: Option, + #[doc = "ServiceBus connection string."] + #[serde(rename = "serviceBusConnectionString", default, skip_serializing_if = "Option::is_none")] + pub service_bus_connection_string: Option, + #[doc = "Extension principal-id."] + #[serde(rename = "extensionPrincipalId", default, skip_serializing_if = "Option::is_none")] + pub extension_principal_id: Option, + #[doc = "Extension instance release train."] + #[serde(rename = "extensionInstanceReleaseTrain", default, skip_serializing_if = "Option::is_none")] + pub extension_instance_release_train: Option, + #[doc = "VC name."] + #[serde(rename = "vcName", default, skip_serializing_if = "Option::is_none")] + pub vc_name: Option, + #[doc = "Compute namespace"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - #[doc = "Admin credentials for virtual machine"] - #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] - pub administrator_account: Option, + pub namespace: Option, + #[doc = "Default instance type"] + #[serde(rename = "defaultInstanceType", default, skip_serializing_if = "Option::is_none")] + pub default_instance_type: Option, + #[doc = "Instance Type Schema"] + #[serde(rename = "instanceTypes", default, skip_serializing_if = "Option::is_none")] + pub instance_types: Option, } -impl HdInsightProperties { +impl KubernetesProperties { pub fn new() -> Self { Self::default() } } +#[doc = "Kubernetes Compute Schema"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HdInsightSchema { - #[doc = "HDInsight compute properties"] +pub struct KubernetesSchema { + #[doc = "Kubernetes properties"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } -impl HdInsightSchema { +impl KubernetesSchema { pub fn new() -> Self { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdfsDatastore { - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if \"Https\" protocol is selected."] - #[serde(rename = "hdfsServerCertificate", default, skip_serializing_if = "Option::is_none")] - pub hdfs_server_certificate: Option, - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "nameNodeAddress")] - pub name_node_address: String, - #[doc = "Protocol used to communicate with the storage account (Https/Http)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, +#[doc = "The List Aml user feature operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListAmlUserFeatureResult { + #[doc = "The list of AML user facing features."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, } -impl HdfsDatastore { - pub fn new(datastore: Datastore, name_node_address: String) -> Self { - Self { - datastore, - hdfs_server_certificate: None, - name_node_address, - protocol: None, - } +impl azure_core::Continuable for ListAmlUserFeatureResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) } } -#[doc = "Reference to an asset via its ARM resource ID."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "[Required] ARM resource ID of the asset."] - #[serde(rename = "assetId")] - pub asset_id: String, +impl ListAmlUserFeatureResult { + pub fn new() -> Self { + Self::default() + } } -impl IdAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase, asset_id: String) -> Self { - Self { - asset_reference_base, - asset_id, - } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListNotebookKeysResult { + #[serde(rename = "primaryAccessKey", default, skip_serializing_if = "Option::is_none")] + pub primary_access_key: Option, + #[serde(rename = "secondaryAccessKey", default, skip_serializing_if = "Option::is_none")] + pub secondary_access_key: Option, +} +impl ListNotebookKeysResult { + pub fn new() -> Self { + Self::default() } } -#[doc = "Base definition for identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdentityConfiguration { - #[doc = "Enum to determine identity framework."] - #[serde(rename = "identityType")] - pub identity_type: IdentityConfigurationType, +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListStorageAccountKeysResult { + #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] + pub user_storage_key: Option, } -impl IdentityConfiguration { - pub fn new(identity_type: IdentityConfigurationType) -> Self { - Self { identity_type } +impl ListStorageAccountKeysResult { + pub fn new() -> Self { + Self::default() } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "identityType")] -pub enum IdentityConfigurationUnion { - #[serde(rename = "AMLToken")] - AmlToken(AmlToken), - Managed(ManagedIdentity), - UserIdentity(UserIdentity), +#[doc = "The List Usages operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListUsagesResult { + #[doc = "The list of AML resource usages."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ListUsagesResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl ListUsagesResult { + pub fn new() -> Self { + Self::default() + } } -#[doc = "Enum to determine identity framework."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IdentityConfigurationType")] -pub enum IdentityConfigurationType { - Managed, - #[serde(rename = "AMLToken")] - AmlToken, - UserIdentity, +#[serde(remote = "ListViewType")] +pub enum ListViewType { + ActiveOnly, + ArchivedOnly, + All, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for IdentityConfigurationType { +impl FromStr for ListViewType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for IdentityConfigurationType { +impl<'de> Deserialize<'de> for ListViewType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -7396,710 +5778,253 @@ impl<'de> Deserialize<'de> for IdentityConfigurationType { Ok(deserialized) } } -impl Serialize for IdentityConfigurationType { +impl Serialize for ListViewType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Managed => serializer.serialize_unit_variant("IdentityConfigurationType", 0u32, "Managed"), - Self::AmlToken => serializer.serialize_unit_variant("IdentityConfigurationType", 1u32, "AMLToken"), - Self::UserIdentity => serializer.serialize_unit_variant("IdentityConfigurationType", 2u32, "UserIdentity"), + Self::ActiveOnly => serializer.serialize_unit_variant("ListViewType", 0u32, "ActiveOnly"), + Self::ArchivedOnly => serializer.serialize_unit_variant("ListViewType", 1u32, "ArchivedOnly"), + Self::All => serializer.serialize_unit_variant("ListViewType", 2u32, "All"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Identity that will be used to access key vault for encryption at rest"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdentityForCmk { - #[doc = "The ArmId of the user assigned identity that will be used to access the customer managed key vault"] - #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identity: Option, +pub struct ListWorkspaceKeysResult { + #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] + pub user_storage_key: Option, + #[serde(rename = "userStorageResourceId", default, skip_serializing_if = "Option::is_none")] + pub user_storage_resource_id: Option, + #[serde(rename = "appInsightsInstrumentationKey", default, skip_serializing_if = "Option::is_none")] + pub app_insights_instrumentation_key: Option, + #[serde(rename = "containerRegistryCredentials", default, skip_serializing_if = "Option::is_none")] + pub container_registry_credentials: Option, + #[serde(rename = "notebookAccessKeys", default, skip_serializing_if = "Option::is_none")] + pub notebook_access_keys: Option, } -impl IdentityForCmk { +impl ListWorkspaceKeysResult { pub fn new() -> Self { Self::default() } } -#[doc = "Stops compute instance after user defined period of inactivity."] +#[doc = "The List WorkspaceQuotasByVMFamily operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdleShutdownSetting { - #[doc = "Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, +pub struct ListWorkspaceQuotas { + #[doc = "The list of Workspace Quotas by VM Family"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, } -impl IdleShutdownSetting { - pub fn new() -> Self { - Self::default() +impl azure_core::Continuable for ListWorkspaceQuotas { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Image { - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Image reference URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reference: Option, -} -impl Image { +impl ListWorkspaceQuotas { pub fn new() -> Self { Self::default() } } -pub mod image { - use super::*; - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "docker")] - Docker, - #[serde(rename = "azureml")] - Azureml, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Docker => serializer.serialize_unit_variant("Type", 0u32, "docker"), - Self::Azureml => serializer.serialize_unit_variant("Type", 1u32, "azureml"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Docker - } +#[doc = "Literal input type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LiteralJobInput { + #[serde(flatten)] + pub job_input: JobInput, + #[doc = "[Required] Literal value for the input."] + pub value: String, +} +impl LiteralJobInput { + pub fn new(job_input: JobInput, value: String) -> Self { + Self { job_input, value } } } -#[doc = "Annotation type of image data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImageAnnotationType")] -pub enum ImageAnnotationType { - Classification, - BoundingBox, - InstanceSegmentation, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ImageAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ImageAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } +pub struct MlFlowModelJobInput { + #[serde(flatten)] + pub asset_job_input: AssetJobInput, + #[serde(flatten)] + pub job_input: JobInput, } -impl Serialize for ImageAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("ImageAnnotationType", 0u32, "Classification"), - Self::BoundingBox => serializer.serialize_unit_variant("ImageAnnotationType", 1u32, "BoundingBox"), - Self::InstanceSegmentation => serializer.serialize_unit_variant("ImageAnnotationType", 2u32, "InstanceSegmentation"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), +impl MlFlowModelJobInput { + pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { + Self { + asset_job_input, + job_input, } } } -#[doc = "Image Classification. Multi-class image classification is used when an image is classified with only a single label\r\nfrom a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassification { +pub struct MlFlowModelJobOutput { #[serde(flatten)] - pub image_classification_base: ImageClassificationBase, + pub asset_job_output: AssetJobOutput, #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, + pub job_output: JobOutput, } -impl ImageClassification { - pub fn new(image_classification_base: ImageClassificationBase, auto_ml_vertical: AutoMlVertical) -> Self { +impl MlFlowModelJobOutput { + pub fn new(job_output: JobOutput) -> Self { Self { - image_classification_base, - auto_ml_vertical, - primary_metric: None, + asset_job_output: AssetJobOutput::default(), + job_output, } } } +#[doc = "MLTable data definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassificationBase { +pub struct MlTableData { #[serde(flatten)] - pub image_vertical: ImageVertical, - #[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelSettings", default, skip_serializing_if = "Option::is_none")] - pub model_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] + pub data_version_base: DataVersionBase, + #[doc = "Uris referenced in the MLTable definition (required for lineage)"] #[serde( - rename = "searchSpace", + rename = "referencedUris", default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub search_space: Vec, + pub referenced_uris: Vec, } -impl ImageClassificationBase { - pub fn new(image_vertical: ImageVertical) -> Self { +impl MlTableData { + pub fn new(data_version_base: DataVersionBase) -> Self { Self { - image_vertical, - model_settings: None, - search_space: Vec::new(), + data_version_base, + referenced_uris: Vec::new(), } } } -#[doc = "Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels\r\nfrom a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassificationMultilabel { +pub struct MlTableJobInput { #[serde(flatten)] - pub image_classification_base: ImageClassificationBase, + pub asset_job_input: AssetJobInput, #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification multilabel tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, + pub job_input: JobInput, } -impl ImageClassificationMultilabel { - pub fn new(image_classification_base: ImageClassificationBase, auto_ml_vertical: AutoMlVertical) -> Self { +impl MlTableJobInput { + pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { Self { - image_classification_base, - auto_ml_vertical, - primary_metric: None, + asset_job_input, + job_input, } } } -#[doc = "Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level,\r\ndrawing a polygon around each object in the image."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageInstanceSegmentation { +pub struct MlTableJobOutput { #[serde(flatten)] - pub image_object_detection_base: ImageObjectDetectionBase, + pub asset_job_output: AssetJobOutput, #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for InstanceSegmentation tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, + pub job_output: JobOutput, } -impl ImageInstanceSegmentation { - pub fn new(image_object_detection_base: ImageObjectDetectionBase, auto_ml_vertical: AutoMlVertical) -> Self { +impl MlTableJobOutput { + pub fn new(job_output: JobOutput) -> Self { Self { - image_object_detection_base, - auto_ml_vertical, - primary_metric: None, + asset_job_output: AssetJobOutput::default(), + job_output, } } } -#[doc = "Limit settings for the AutoML job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageLimitSettings { - #[doc = "Maximum number of concurrent AutoML iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Maximum number of AutoML iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl ImageLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Returns metadata about the operating system image for this compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageMetadata { - #[doc = "Specifies the current operating system image version this compute instance is running on."] - #[serde(rename = "currentImageVersion", default, skip_serializing_if = "Option::is_none")] - pub current_image_version: Option, - #[doc = "Specifies the latest available operating system image version."] - #[serde(rename = "latestImageVersion", default, skip_serializing_if = "Option::is_none")] - pub latest_image_version: Option, - #[doc = "Specifies whether this compute instance is running on the latest operating system image."] - #[serde(rename = "isLatestOsImageVersion", default, skip_serializing_if = "Option::is_none")] - pub is_latest_os_image_version: Option, -} -impl ImageMetadata { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettings { - #[doc = "Enable AMSGrad when optimizer is 'adam' or 'adamw'."] - #[serde(rename = "amsGradient", default, skip_serializing_if = "Option::is_none")] - pub ams_gradient: Option, - #[doc = "Settings for using Augmentations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub augmentations: Option, - #[doc = "Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta1: Option, - #[doc = "Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta2: Option, - #[doc = "Whether to use distributer training."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distributed: Option, - #[doc = "Enable early stopping logic during training."] - #[serde(rename = "earlyStopping", default, skip_serializing_if = "Option::is_none")] - pub early_stopping: Option, - #[doc = "Minimum number of epochs or validation evaluations to wait before primary metric improvement\r\nis tracked for early stopping. Must be a positive integer."] - #[serde(rename = "earlyStoppingDelay", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_delay: Option, - #[doc = "Minimum number of epochs or validation evaluations with no primary metric improvement before\r\nthe run is stopped. Must be a positive integer."] - #[serde(rename = "earlyStoppingPatience", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_patience: Option, - #[doc = "Enable normalization when exporting ONNX model."] - #[serde(rename = "enableOnnxNormalization", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_normalization: Option, - #[doc = "Frequency to evaluate validation dataset to get metric scores. Must be a positive integer."] - #[serde(rename = "evaluationFrequency", default, skip_serializing_if = "Option::is_none")] - pub evaluation_frequency: Option, - #[doc = "Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps without\r\nupdating the model weights while accumulating the gradients of those steps, and then using\r\nthe accumulated gradients to compute the weight updates. Must be a positive integer."] - #[serde(rename = "gradientAccumulationStep", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_step: Option, - #[doc = "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "layersToFreeze", default, skip_serializing_if = "Option::is_none")] - pub layers_to_freeze: Option, - #[doc = "Initial learning rate. Must be a float in the range [0, 1]."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub momentum: Option, - #[doc = "Enable nesterov when optimizer is 'sgd'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nesterov: Option, - #[doc = "Number of training epochs. Must be a positive integer."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "Number of data loader workers. Must be a non-negative integer."] - #[serde(rename = "numberOfWorkers", default, skip_serializing_if = "Option::is_none")] - pub number_of_workers: Option, - #[doc = "Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub optimizer: Option, - #[doc = "Random seed to be used when using deterministic training."] - #[serde(rename = "randomSeed", default, skip_serializing_if = "Option::is_none")] - pub random_seed: Option, - #[doc = "Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]."] - #[serde(rename = "stepLRGamma", default, skip_serializing_if = "Option::is_none")] - pub step_lr_gamma: Option, - #[doc = "Value of step size when learning rate scheduler is 'step'. Must be a positive integer."] - #[serde(rename = "stepLRStepSize", default, skip_serializing_if = "Option::is_none")] - pub step_lr_step_size: Option, - #[doc = "Training batch size. Must be a positive integer."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "Validation batch size. Must be a positive integer."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]."] - #[serde(rename = "warmupCosineLRCycles", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_cycles: Option, - #[doc = "Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer."] - #[serde(rename = "warmupCosineLRWarmupEpochs", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_warmup_epochs: Option, - #[doc = "Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl ImageModelDistributionSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettingsClassification { - #[serde(flatten)] - pub image_model_distribution_settings: ImageModelDistributionSettings, - #[doc = "Image crop size that is input to the neural network for the training dataset. Must be a positive integer."] - #[serde(rename = "trainingCropSize", default, skip_serializing_if = "Option::is_none")] - pub training_crop_size: Option, - #[doc = "Image crop size that is input to the neural network for the validation dataset. Must be a positive integer."] - #[serde(rename = "validationCropSize", default, skip_serializing_if = "Option::is_none")] - pub validation_crop_size: Option, - #[doc = "Image size to which to resize before cropping for validation dataset. Must be a positive integer."] - #[serde(rename = "validationResizeSize", default, skip_serializing_if = "Option::is_none")] - pub validation_resize_size: Option, - #[doc = "Weighted loss. The accepted values are 0 for no weighted loss.\r\n1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2."] - #[serde(rename = "weightedLoss", default, skip_serializing_if = "Option::is_none")] - pub weighted_loss: Option, -} -impl ImageModelDistributionSettingsClassification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettingsObjectDetection { - #[serde(flatten)] - pub image_model_distribution_settings: ImageModelDistributionSettings, - #[doc = "Maximum number of detections per image, for all classes. Must be a positive integer.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "boxDetectionsPerImage", default, skip_serializing_if = "Option::is_none")] - pub box_detections_per_image: Option, - #[doc = "During inference, only return proposals with a classification score greater than\r\nBoxScoreThreshold. Must be a float in the range[0, 1]."] - #[serde(rename = "boxScoreThreshold", default, skip_serializing_if = "Option::is_none")] - pub box_score_threshold: Option, - #[doc = "Image size for train and validation. Must be a positive integer.\r\nNote: The training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "imageSize", default, skip_serializing_if = "Option::is_none")] - pub image_size: Option, - #[doc = "Maximum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "maxSize", default, skip_serializing_if = "Option::is_none")] - pub max_size: Option, - #[doc = "Minimum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "minSize", default, skip_serializing_if = "Option::is_none")] - pub min_size: Option, - #[doc = "Model size. Must be 'small', 'medium', 'large', or 'xlarge'.\r\nNote: training run may get into CUDA OOM if the model size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "modelSize", default, skip_serializing_if = "Option::is_none")] - pub model_size: Option, - #[doc = "Enable multi-scale image by varying image size by +/- 50%.\r\nNote: training run may get into CUDA OOM if no sufficient GPU memory.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "multiScale", default, skip_serializing_if = "Option::is_none")] - pub multi_scale: Option, - #[doc = "IOU threshold used during inference in NMS post processing. Must be float in the range [0, 1]."] - #[serde(rename = "nmsIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub nms_iou_threshold: Option, - #[doc = "The grid size to use for tiling each image. Note: TileGridSize must not be\r\nNone to enable small object detection logic. A string containing two integers in mxn format.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileGridSize", default, skip_serializing_if = "Option::is_none")] - pub tile_grid_size: Option, - #[doc = "Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileOverlapRatio", default, skip_serializing_if = "Option::is_none")] - pub tile_overlap_ratio: Option, - #[doc = "The IOU threshold to use to perform NMS while merging predictions from tiles and image.\r\nUsed in validation/ inference. Must be float in the range [0, 1].\r\nNote: This settings is not supported for the 'yolov5' algorithm.\r\nNMS: Non-maximum suppression"] - #[serde(rename = "tilePredictionsNmsThreshold", default, skip_serializing_if = "Option::is_none")] - pub tile_predictions_nms_threshold: Option, - #[doc = "IOU threshold to use when computing validation metric. Must be float in the range [0, 1]."] - #[serde(rename = "validationIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub validation_iou_threshold: Option, - #[doc = "Metric computation method to use for validation metrics. Must be 'none', 'coco', 'voc', or 'coco_voc'."] - #[serde(rename = "validationMetricType", default, skip_serializing_if = "Option::is_none")] - pub validation_metric_type: Option, -} -impl ImageModelDistributionSettingsObjectDetection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettings { - #[doc = "Settings for advanced scenarios."] - #[serde(rename = "advancedSettings", default, skip_serializing_if = "Option::is_none")] - pub advanced_settings: Option, - #[doc = "Enable AMSGrad when optimizer is 'adam' or 'adamw'."] - #[serde(rename = "amsGradient", default, skip_serializing_if = "Option::is_none")] - pub ams_gradient: Option, - #[doc = "Settings for using Augmentations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub augmentations: Option, - #[doc = "Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta1: Option, - #[doc = "Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta2: Option, - #[doc = "Frequency to store model checkpoints. Must be a positive integer."] - #[serde(rename = "checkpointFrequency", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_frequency: Option, - #[serde(rename = "checkpointModel", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_model: Option, - #[doc = "The id of a previous run that has a pretrained checkpoint for incremental training."] - #[serde(rename = "checkpointRunId", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_run_id: Option, - #[doc = "Whether to use distributed training."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distributed: Option, - #[doc = "Enable early stopping logic during training."] - #[serde(rename = "earlyStopping", default, skip_serializing_if = "Option::is_none")] - pub early_stopping: Option, - #[doc = "Minimum number of epochs or validation evaluations to wait before primary metric improvement\r\nis tracked for early stopping. Must be a positive integer."] - #[serde(rename = "earlyStoppingDelay", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_delay: Option, - #[doc = "Minimum number of epochs or validation evaluations with no primary metric improvement before\r\nthe run is stopped. Must be a positive integer."] - #[serde(rename = "earlyStoppingPatience", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_patience: Option, - #[doc = "Enable normalization when exporting ONNX model."] - #[serde(rename = "enableOnnxNormalization", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_normalization: Option, - #[doc = "Frequency to evaluate validation dataset to get metric scores. Must be a positive integer."] - #[serde(rename = "evaluationFrequency", default, skip_serializing_if = "Option::is_none")] - pub evaluation_frequency: Option, - #[doc = "Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps without\r\nupdating the model weights while accumulating the gradients of those steps, and then using\r\nthe accumulated gradients to compute the weight updates. Must be a positive integer."] - #[serde(rename = "gradientAccumulationStep", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_step: Option, - #[doc = "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "layersToFreeze", default, skip_serializing_if = "Option::is_none")] - pub layers_to_freeze: Option, - #[doc = "Initial learning rate. Must be a float in the range [0, 1]."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Learning rate scheduler enum."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub momentum: Option, - #[doc = "Enable nesterov when optimizer is 'sgd'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nesterov: Option, - #[doc = "Number of training epochs. Must be a positive integer."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "Number of data loader workers. Must be a non-negative integer."] - #[serde(rename = "numberOfWorkers", default, skip_serializing_if = "Option::is_none")] - pub number_of_workers: Option, - #[doc = "Stochastic optimizer for image models."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub optimizer: Option, - #[doc = "Random seed to be used when using deterministic training."] - #[serde(rename = "randomSeed", default, skip_serializing_if = "Option::is_none")] - pub random_seed: Option, - #[doc = "Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]."] - #[serde(rename = "stepLRGamma", default, skip_serializing_if = "Option::is_none")] - pub step_lr_gamma: Option, - #[doc = "Value of step size when learning rate scheduler is 'step'. Must be a positive integer."] - #[serde(rename = "stepLRStepSize", default, skip_serializing_if = "Option::is_none")] - pub step_lr_step_size: Option, - #[doc = "Training batch size. Must be a positive integer."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "Validation batch size. Must be a positive integer."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]."] - #[serde(rename = "warmupCosineLRCycles", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_cycles: Option, - #[doc = "Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer."] - #[serde(rename = "warmupCosineLRWarmupEpochs", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_warmup_epochs: Option, - #[doc = "Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl ImageModelSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettingsClassification { - #[serde(flatten)] - pub image_model_settings: ImageModelSettings, - #[doc = "Image crop size that is input to the neural network for the training dataset. Must be a positive integer."] - #[serde(rename = "trainingCropSize", default, skip_serializing_if = "Option::is_none")] - pub training_crop_size: Option, - #[doc = "Image crop size that is input to the neural network for the validation dataset. Must be a positive integer."] - #[serde(rename = "validationCropSize", default, skip_serializing_if = "Option::is_none")] - pub validation_crop_size: Option, - #[doc = "Image size to which to resize before cropping for validation dataset. Must be a positive integer."] - #[serde(rename = "validationResizeSize", default, skip_serializing_if = "Option::is_none")] - pub validation_resize_size: Option, - #[doc = "Weighted loss. The accepted values are 0 for no weighted loss.\r\n1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2."] - #[serde(rename = "weightedLoss", default, skip_serializing_if = "Option::is_none")] - pub weighted_loss: Option, -} -impl ImageModelSettingsClassification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettingsObjectDetection { - #[serde(flatten)] - pub image_model_settings: ImageModelSettings, - #[doc = "Maximum number of detections per image, for all classes. Must be a positive integer.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "boxDetectionsPerImage", default, skip_serializing_if = "Option::is_none")] - pub box_detections_per_image: Option, - #[doc = "During inference, only return proposals with a classification score greater than\r\nBoxScoreThreshold. Must be a float in the range[0, 1]."] - #[serde(rename = "boxScoreThreshold", default, skip_serializing_if = "Option::is_none")] - pub box_score_threshold: Option, - #[doc = "Image size for train and validation. Must be a positive integer.\r\nNote: The training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "imageSize", default, skip_serializing_if = "Option::is_none")] - pub image_size: Option, - #[doc = "Maximum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "maxSize", default, skip_serializing_if = "Option::is_none")] - pub max_size: Option, - #[doc = "Minimum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "minSize", default, skip_serializing_if = "Option::is_none")] - pub min_size: Option, - #[doc = "Image model size."] - #[serde(rename = "modelSize", default, skip_serializing_if = "Option::is_none")] - pub model_size: Option, - #[doc = "Enable multi-scale image by varying image size by +/- 50%.\r\nNote: training run may get into CUDA OOM if no sufficient GPU memory.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "multiScale", default, skip_serializing_if = "Option::is_none")] - pub multi_scale: Option, - #[doc = "IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1]."] - #[serde(rename = "nmsIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub nms_iou_threshold: Option, - #[doc = "The grid size to use for tiling each image. Note: TileGridSize must not be\r\nNone to enable small object detection logic. A string containing two integers in mxn format.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileGridSize", default, skip_serializing_if = "Option::is_none")] - pub tile_grid_size: Option, - #[doc = "Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileOverlapRatio", default, skip_serializing_if = "Option::is_none")] - pub tile_overlap_ratio: Option, - #[doc = "The IOU threshold to use to perform NMS while merging predictions from tiles and image.\r\nUsed in validation/ inference. Must be float in the range [0, 1].\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tilePredictionsNmsThreshold", default, skip_serializing_if = "Option::is_none")] - pub tile_predictions_nms_threshold: Option, - #[doc = "IOU threshold to use when computing validation metric. Must be float in the range [0, 1]."] - #[serde(rename = "validationIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub validation_iou_threshold: Option, - #[doc = "Metric computation method to use for validation metrics in image tasks."] - #[serde(rename = "validationMetricType", default, skip_serializing_if = "Option::is_none")] - pub validation_metric_type: Option, -} -impl ImageModelSettingsObjectDetection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Image Object Detection. Object detection is used to identify objects in an image and locate each object with a\r\nbounding box e.g. locate all dogs and cats in an image and draw a bounding box around each."] +#[doc = "Managed identity configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageObjectDetection { - #[serde(flatten)] - pub image_object_detection_base: ImageObjectDetectionBase, +pub struct ManagedIdentity { #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for Image ObjectDetection task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, + pub identity_configuration: IdentityConfiguration, + #[doc = "Specifies a user-assigned identity by client ID. For system-assigned, do not set this field."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[doc = "Specifies a user-assigned identity by object ID. For system-assigned, do not set this field."] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option, + #[doc = "Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not set this field."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, } -impl ImageObjectDetection { - pub fn new(image_object_detection_base: ImageObjectDetectionBase, auto_ml_vertical: AutoMlVertical) -> Self { +impl ManagedIdentity { + pub fn new(identity_configuration: IdentityConfiguration) -> Self { Self { - image_object_detection_base, - auto_ml_vertical, - primary_metric: None, + identity_configuration, + client_id: None, + object_id: None, + resource_id: None, } } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageObjectDetectionBase { +pub struct ManagedIdentityAuthTypeWorkspaceConnectionProperties { #[serde(flatten)] - pub image_vertical: ImageVertical, - #[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelSettings", default, skip_serializing_if = "Option::is_none")] - pub model_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, + pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credentials: Option, } -impl ImageObjectDetectionBase { - pub fn new(image_vertical: ImageVertical) -> Self { +impl ManagedIdentityAuthTypeWorkspaceConnectionProperties { + pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { Self { - image_vertical, - model_settings: None, - search_space: Vec::new(), + workspace_connection_properties_v2, + credentials: None, } } } -#[doc = "Model sweeping and hyperparameter sweeping related settings."] +#[doc = "Properties specific to a ManagedOnlineDeployment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, +pub struct ManagedOnlineDeployment { + #[serde(flatten)] + pub online_deployment: OnlineDeployment, } -impl ImageSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } +impl ManagedOnlineDeployment { + pub fn new(online_deployment: OnlineDeployment) -> Self { + Self { online_deployment } } } -#[doc = "Abstract class for AutoML tasks that train image (computer vision) models -\r\nsuch as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation."] +#[doc = "Managed service identity (system assigned and/or user assigned identities)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageVertical { - #[doc = "Limit settings for the AutoML job."] - #[serde(rename = "limitSettings")] - pub limit_settings: ImageLimitSettings, - #[doc = "Model sweeping and hyperparameter sweeping related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, - #[doc = "The fraction of training dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "validationDataSize", default, skip_serializing_if = "Option::is_none")] - pub validation_data_size: Option, -} -impl ImageVertical { - pub fn new(limit_settings: ImageLimitSettings) -> Self { +pub struct ManagedServiceIdentity { + #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] + #[serde(rename = "type")] + pub type_: ManagedServiceIdentityType, + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl ManagedServiceIdentity { + pub fn new(type_: ManagedServiceIdentityType) -> Self { Self { - limit_settings, - sweep_settings: None, - validation_data: None, - validation_data_size: None, + principal_id: None, + tenant_id: None, + type_, + user_assigned_identities: None, } } } -#[doc = "Whether IncrementalDataRefresh is enabled"] +#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IncrementalDataRefresh")] -pub enum IncrementalDataRefresh { - Enabled, - Disabled, +#[serde(remote = "ManagedServiceIdentityType")] +pub enum ManagedServiceIdentityType { + None, + SystemAssigned, + UserAssigned, + #[serde(rename = "SystemAssigned,UserAssigned")] + SystemAssignedUserAssigned, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for IncrementalDataRefresh { +impl FromStr for ManagedServiceIdentityType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for IncrementalDataRefresh { +impl<'de> Deserialize<'de> for ManagedServiceIdentityType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -8109,3736 +6034,554 @@ impl<'de> Deserialize<'de> for IncrementalDataRefresh { Ok(deserialized) } } -impl Serialize for IncrementalDataRefresh { +impl Serialize for ManagedServiceIdentityType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Enabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 1u32, "Disabled"), + Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => { + serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned,UserAssigned") + } Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Dto object representing index column"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IndexColumn { - #[doc = "Specifies the column name"] - #[serde(rename = "columnName", default, skip_serializing_if = "Option::is_none")] - pub column_name: Option, - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option, -} -impl IndexColumn { - pub fn new() -> Self { - Self::default() +#[doc = "Defines an early termination policy based on running averages of the primary metric of all runs"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MedianStoppingPolicy { + #[serde(flatten)] + pub early_termination_policy: EarlyTerminationPolicy, +} +impl MedianStoppingPolicy { + pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { + Self { early_termination_policy } } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InferenceContainerProperties { - #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] - pub liveness_route: Option, - #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] - pub readiness_route: Option, - #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] - pub scoring_route: Option, +pub struct ModelContainer { + #[serde(flatten)] + pub asset_container: AssetContainer, } -impl InferenceContainerProperties { +impl ModelContainer { pub fn new() -> Self { Self::default() } } +#[doc = "Azure Resource Manager resource envelope."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct InferencingServer { - #[doc = "Inferencing server type for various targets."] - #[serde(rename = "serverType")] - pub server_type: InferencingServerType, -} -impl InferencingServer { - pub fn new(server_type: InferencingServerType) -> Self { - Self { server_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "serverType")] -pub enum InferencingServerUnion { - #[serde(rename = "AzureMLBatch")] - AzureMlBatch(AzureMlBatchInferencingServer), - #[serde(rename = "AzureMLOnline")] - AzureMlOnline(AzureMlOnlineInferencingServer), - Custom(CustomInferencingServer), - Triton(TritonInferencingServer), -} -#[doc = "Inferencing server type for various targets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InferencingServerType")] -pub enum InferencingServerType { - #[serde(rename = "AzureMLOnline")] - AzureMlOnline, - #[serde(rename = "AzureMLBatch")] - AzureMlBatch, - Triton, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InferencingServerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InferencingServerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InferencingServerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureMlOnline => serializer.serialize_unit_variant("InferencingServerType", 0u32, "AzureMLOnline"), - Self::AzureMlBatch => serializer.serialize_unit_variant("InferencingServerType", 1u32, "AzureMLBatch"), - Self::Triton => serializer.serialize_unit_variant("InferencingServerType", 2u32, "Triton"), - Self::Custom => serializer.serialize_unit_variant("InferencingServerType", 3u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the input data delivery mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InputDeliveryMode")] -pub enum InputDeliveryMode { - ReadOnlyMount, - ReadWriteMount, - Download, - Direct, - EvalMount, - EvalDownload, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadOnlyMount => serializer.serialize_unit_variant("InputDeliveryMode", 0u32, "ReadOnlyMount"), - Self::ReadWriteMount => serializer.serialize_unit_variant("InputDeliveryMode", 1u32, "ReadWriteMount"), - Self::Download => serializer.serialize_unit_variant("InputDeliveryMode", 2u32, "Download"), - Self::Direct => serializer.serialize_unit_variant("InputDeliveryMode", 3u32, "Direct"), - Self::EvalMount => serializer.serialize_unit_variant("InputDeliveryMode", 4u32, "EvalMount"), - Self::EvalDownload => serializer.serialize_unit_variant("InputDeliveryMode", 5u32, "EvalDownload"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Input path type for package inputs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InputPathType")] -pub enum InputPathType { - Url, - PathId, - PathVersion, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InputPathType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InputPathType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InputPathType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Url => serializer.serialize_unit_variant("InputPathType", 0u32, "Url"), - Self::PathId => serializer.serialize_unit_variant("InputPathType", 1u32, "PathId"), - Self::PathVersion => serializer.serialize_unit_variant("InputPathType", 2u32, "PathVersion"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Resource requests/limits for this instance type"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InstanceResourceSchema {} -impl InstanceResourceSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Primary metrics for InstanceSegmentation tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InstanceSegmentationPrimaryMetrics")] -pub enum InstanceSegmentationPrimaryMetrics { - MeanAveragePrecision, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InstanceSegmentationPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InstanceSegmentationPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InstanceSegmentationPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAveragePrecision => { - serializer.serialize_unit_variant("InstanceSegmentationPrimaryMetrics", 0u32, "MeanAveragePrecision") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Instance type schema."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InstanceTypeSchema { - #[doc = "Node Selector"] - #[serde(rename = "nodeSelector", default, skip_serializing_if = "Option::is_none")] - pub node_selector: Option, - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl InstanceTypeSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod instance_type_schema { - use super::*; - #[doc = "Resource requests/limits for this instance type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Resources { - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requests: Option, - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, - } - impl Resources { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Base definition for a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobBase { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "ARM resource ID of the component resource."] - #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] - pub component_id: Option, - #[doc = "ARM resource ID of the compute resource."] - #[serde(rename = "computeId", default, skip_serializing_if = "Option::is_none")] - pub compute_id: Option, - #[doc = "Display name of job."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The name of the experiment the job belongs to. If not set, the job is placed in the \"Default\" experiment."] - #[serde(rename = "experimentName", default, skip_serializing_if = "Option::is_none")] - pub experiment_name: Option, - #[doc = "Base definition for identity configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Is the asset archived?"] - #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] - pub is_archived: Option, - #[doc = "Enum to determine the type of job."] - #[serde(rename = "jobType")] - pub job_type: JobType, - #[doc = "Configuration for notification."] - #[serde(rename = "notificationSetting", default, skip_serializing_if = "Option::is_none")] - pub notification_setting: Option, - #[doc = "List of JobEndpoints.\r\nFor local jobs, a job endpoint will have an endpoint value of FileStreamObject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub services: Option, - #[doc = "The status of a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl JobBase { - pub fn new(job_type: JobType) -> Self { - Self { - resource_base: ResourceBase::default(), - component_id: None, - compute_id: None, - display_name: None, - experiment_name: None, - identity: None, - is_archived: None, - job_type, - notification_setting: None, - services: None, - status: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobType")] -pub enum JobBaseUnion { - #[serde(rename = "AutoML")] - AutoMl(AutoMlJob), - Command(CommandJob), - Labeling(LabelingJob), - Pipeline(PipelineJob), - Spark(SparkJob), - Sweep(SweepJob), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobBaseResource { +pub struct ModelContainerResource { #[serde(flatten)] pub resource: Resource, - #[doc = "Base definition for a job."] - pub properties: JobBaseUnion, + pub properties: ModelContainer, } -impl JobBaseResource { - pub fn new(properties: JobBaseUnion) -> Self { +impl ModelContainerResource { + pub fn new(properties: ModelContainer) -> Self { Self { resource: Resource::default(), properties, } } } -#[doc = "A paginated list of JobBase entities."] +#[doc = "A paginated list of ModelContainer entities."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobBaseResourceArmPaginatedResult { - #[doc = "The link to the next page of JobBase objects. If null, there are no additional pages."] +pub struct ModelContainerResourceArmPaginatedResult { + #[doc = "The link to the next page of ModelContainer objects. If null, there are no additional pages."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, - #[doc = "An array of objects of type JobBase."] + #[doc = "An array of objects of type ModelContainer."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } -impl azure_core::Continuable for JobBaseResourceArmPaginatedResult { +impl azure_core::Continuable for ModelContainerResourceArmPaginatedResult { type Continuation = String; fn continuation(&self) -> Option { self.next_link.clone().filter(|value| !value.is_empty()) } } -impl JobBaseResourceArmPaginatedResult { +impl ModelContainerResourceArmPaginatedResult { pub fn new() -> Self { Self::default() } } -#[doc = "Command job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobInput { - #[doc = "Description for the input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Enum to determine the Job Input Type."] - #[serde(rename = "jobInputType")] - pub job_input_type: JobInputType, -} -impl JobInput { - pub fn new(job_input_type: JobInputType) -> Self { - Self { - description: None, - job_input_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobInputType")] -pub enum JobInputUnion { - #[serde(rename = "custom_model")] - CustomModel(CustomModelJobInput), - #[serde(rename = "literal")] - Literal(LiteralJobInput), - #[serde(rename = "mlflow_model")] - MlflowModel(MlFlowModelJobInput), - #[serde(rename = "mltable")] - Mltable(MlTableJobInput), - #[serde(rename = "triton_model")] - TritonModel(TritonModelJobInput), - #[serde(rename = "uri_file")] - UriFile(UriFileJobInput), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderJobInput), -} -#[doc = "Enum to determine the Job Input Type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobInputType")] -pub enum JobInputType { - #[serde(rename = "literal")] - Literal, - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(rename = "custom_model")] - CustomModel, - #[serde(rename = "mlflow_model")] - MlflowModel, - #[serde(rename = "triton_model")] - TritonModel, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobInputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobInputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobInputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Literal => serializer.serialize_unit_variant("JobInputType", 0u32, "literal"), - Self::UriFile => serializer.serialize_unit_variant("JobInputType", 1u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("JobInputType", 2u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("JobInputType", 3u32, "mltable"), - Self::CustomModel => serializer.serialize_unit_variant("JobInputType", 4u32, "custom_model"), - Self::MlflowModel => serializer.serialize_unit_variant("JobInputType", 5u32, "mlflow_model"), - Self::TritonModel => serializer.serialize_unit_variant("JobInputType", 6u32, "triton_model"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobLimits { - #[serde(rename = "jobLimitsType")] - pub job_limits_type: JobLimitsType, - #[doc = "The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl JobLimits { - pub fn new(job_limits_type: JobLimitsType) -> Self { - Self { - job_limits_type, - timeout: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobLimitsType")] -pub enum JobLimitsUnion { - Command(CommandJobLimits), - Sweep(SweepJobLimits), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobLimitsType")] -pub enum JobLimitsType { - Command, - Sweep, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobLimitsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobLimitsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobLimitsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Command => serializer.serialize_unit_variant("JobLimitsType", 0u32, "Command"), - Self::Sweep => serializer.serialize_unit_variant("JobLimitsType", 1u32, "Sweep"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Job output definition container information on where to find job output/logs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobOutput { - #[doc = "Description for the output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Enum to determine the Job Output Type."] - #[serde(rename = "jobOutputType")] - pub job_output_type: JobOutputType, -} -impl JobOutput { - pub fn new(job_output_type: JobOutputType) -> Self { - Self { - description: None, - job_output_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobOutputType")] -pub enum JobOutputUnion { - #[serde(rename = "custom_model")] - CustomModel(CustomModelJobOutput), - #[serde(rename = "mlflow_model")] - MlflowModel(MlFlowModelJobOutput), - #[serde(rename = "mltable")] - Mltable(MlTableJobOutput), - #[serde(rename = "triton_model")] - TritonModel(TritonModelJobOutput), - #[serde(rename = "uri_file")] - UriFile(UriFileJobOutput), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderJobOutput), -} -#[doc = "Enum to determine the Job Output Type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobOutputType")] -pub enum JobOutputType { - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(rename = "custom_model")] - CustomModel, - #[serde(rename = "mlflow_model")] - MlflowModel, - #[serde(rename = "triton_model")] - TritonModel, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobOutputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobOutputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobOutputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("JobOutputType", 0u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("JobOutputType", 1u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("JobOutputType", 2u32, "mltable"), - Self::CustomModel => serializer.serialize_unit_variant("JobOutputType", 3u32, "custom_model"), - Self::MlflowModel => serializer.serialize_unit_variant("JobOutputType", 4u32, "mlflow_model"), - Self::TritonModel => serializer.serialize_unit_variant("JobOutputType", 5u32, "triton_model"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the job provisioning state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobProvisioningState")] -pub enum JobProvisioningState { - Succeeded, - Failed, - Canceled, - InProgress, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("JobProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("JobProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobProvisioningState", 2u32, "Canceled"), - Self::InProgress => serializer.serialize_unit_variant("JobProvisioningState", 3u32, "InProgress"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobResourceConfiguration { - #[serde(flatten)] - pub resource_configuration: ResourceConfiguration, - #[doc = "Extra arguments to pass to the Docker run command. This would override any parameters that have already been set by the system, or in this section. This parameter is only supported for Azure ML compute types."] - #[serde(rename = "dockerArgs", default, skip_serializing_if = "Option::is_none")] - pub docker_args: Option, - #[doc = "Size of the docker container's shared memory block. This should be in the format of (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes)."] - #[serde(rename = "shmSize", default, skip_serializing_if = "Option::is_none")] - pub shm_size: Option, -} -impl JobResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobScheduleAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[doc = "Base definition for a job."] - #[serde(rename = "jobDefinition")] - pub job_definition: JobBaseUnion, -} -impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBaseUnion) -> Self { - Self { - schedule_action_base, - job_definition, - } - } -} -#[doc = "Job endpoint definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobService { - #[doc = "Url for endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "Any error in the service."] - #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[doc = "Endpoint type."] - #[serde(rename = "jobServiceType", default, skip_serializing_if = "Option::is_none")] - pub job_service_type: Option, - #[doc = "Abstract Nodes definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nodes: Option, - #[doc = "Port for endpoint set by user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "Additional properties to set on the endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Status of endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl JobService { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The status of a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobStatus")] -pub enum JobStatus { - NotStarted, - Starting, - Provisioning, - Preparing, - Queued, - Running, - Finalizing, - CancelRequested, - Completed, - Failed, - Canceled, - NotResponding, - Paused, - Unknown, - Scheduled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotStarted => serializer.serialize_unit_variant("JobStatus", 0u32, "NotStarted"), - Self::Starting => serializer.serialize_unit_variant("JobStatus", 1u32, "Starting"), - Self::Provisioning => serializer.serialize_unit_variant("JobStatus", 2u32, "Provisioning"), - Self::Preparing => serializer.serialize_unit_variant("JobStatus", 3u32, "Preparing"), - Self::Queued => serializer.serialize_unit_variant("JobStatus", 4u32, "Queued"), - Self::Running => serializer.serialize_unit_variant("JobStatus", 5u32, "Running"), - Self::Finalizing => serializer.serialize_unit_variant("JobStatus", 6u32, "Finalizing"), - Self::CancelRequested => serializer.serialize_unit_variant("JobStatus", 7u32, "CancelRequested"), - Self::Completed => serializer.serialize_unit_variant("JobStatus", 8u32, "Completed"), - Self::Failed => serializer.serialize_unit_variant("JobStatus", 9u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobStatus", 10u32, "Canceled"), - Self::NotResponding => serializer.serialize_unit_variant("JobStatus", 11u32, "NotResponding"), - Self::Paused => serializer.serialize_unit_variant("JobStatus", 12u32, "Paused"), - Self::Unknown => serializer.serialize_unit_variant("JobStatus", 13u32, "Unknown"), - Self::Scheduled => serializer.serialize_unit_variant("JobStatus", 14u32, "Scheduled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the job tier."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobTier")] -pub enum JobTier { - Spot, - Basic, - Standard, - Premium, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobTier { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobTier { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobTier { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Spot => serializer.serialize_unit_variant("JobTier", 0u32, "Spot"), - Self::Basic => serializer.serialize_unit_variant("JobTier", 1u32, "Basic"), - Self::Standard => serializer.serialize_unit_variant("JobTier", 2u32, "Standard"), - Self::Premium => serializer.serialize_unit_variant("JobTier", 3u32, "Premium"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the type of job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobType")] -pub enum JobType { - #[serde(rename = "AutoML")] - AutoMl, - Command, - Labeling, - Sweep, - Pipeline, - Spark, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AutoMl => serializer.serialize_unit_variant("JobType", 0u32, "AutoML"), - Self::Command => serializer.serialize_unit_variant("JobType", 1u32, "Command"), - Self::Labeling => serializer.serialize_unit_variant("JobType", 2u32, "Labeling"), - Self::Sweep => serializer.serialize_unit_variant("JobType", 3u32, "Sweep"), - Self::Pipeline => serializer.serialize_unit_variant("JobType", 4u32, "Pipeline"), - Self::Spark => serializer.serialize_unit_variant("JobType", 5u32, "Spark"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosCredentials { - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "kerberosKdcAddress")] - pub kerberos_kdc_address: String, - #[doc = "[Required] Kerberos Username"] - #[serde(rename = "kerberosPrincipal")] - pub kerberos_principal: String, - #[doc = "[Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service."] - #[serde(rename = "kerberosRealm")] - pub kerberos_realm: String, -} -impl KerberosCredentials { - pub fn new(kerberos_kdc_address: String, kerberos_principal: String, kerberos_realm: String) -> Self { - Self { - kerberos_kdc_address, - kerberos_principal, - kerberos_realm, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosKeytabSecrets, -} -impl KerberosKeytabCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosKeytabSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos keytab secret."] - #[serde(rename = "kerberosKeytab", default, skip_serializing_if = "Option::is_none")] - pub kerberos_keytab: Option, -} -impl KerberosKeytabSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_keytab: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosPasswordSecrets, -} -impl KerberosPasswordCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosPasswordSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos password secret."] - #[serde(rename = "kerberosPassword", default, skip_serializing_if = "Option::is_none")] - pub kerberos_password: Option, -} -impl KerberosPasswordSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_password: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "KeyType")] -pub enum KeyType { - Primary, - Secondary, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for KeyType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for KeyType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for KeyType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Primary => serializer.serialize_unit_variant("KeyType", 0u32, "Primary"), - Self::Secondary => serializer.serialize_unit_variant("KeyType", 1u32, "Secondary"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A Machine Learning compute based on Kubernetes Compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Kubernetes { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub kubernetes_schema: KubernetesSchema, -} -impl Kubernetes { - pub fn new(compute: Compute) -> Self { - Self { - compute, - kubernetes_schema: KubernetesSchema::default(), - } - } -} -#[doc = "Properties specific to a KubernetesOnlineDeployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KubernetesOnlineDeployment { - #[serde(flatten)] - pub online_deployment: OnlineDeployment, - #[doc = "Resource requirements for each container instance within an online deployment."] - #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] - pub container_resource_requirements: Option, -} -impl KubernetesOnlineDeployment { - pub fn new(online_deployment: OnlineDeployment) -> Self { - Self { - online_deployment, - container_resource_requirements: None, - } - } -} -#[doc = "Kubernetes properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KubernetesProperties { - #[doc = "Relay connection string."] - #[serde(rename = "relayConnectionString", default, skip_serializing_if = "Option::is_none")] - pub relay_connection_string: Option, - #[doc = "ServiceBus connection string."] - #[serde(rename = "serviceBusConnectionString", default, skip_serializing_if = "Option::is_none")] - pub service_bus_connection_string: Option, - #[doc = "Extension principal-id."] - #[serde(rename = "extensionPrincipalId", default, skip_serializing_if = "Option::is_none")] - pub extension_principal_id: Option, - #[doc = "Extension instance release train."] - #[serde(rename = "extensionInstanceReleaseTrain", default, skip_serializing_if = "Option::is_none")] - pub extension_instance_release_train: Option, - #[doc = "VC name."] - #[serde(rename = "vcName", default, skip_serializing_if = "Option::is_none")] - pub vc_name: Option, - #[doc = "Compute namespace"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, - #[doc = "Default instance type"] - #[serde(rename = "defaultInstanceType", default, skip_serializing_if = "Option::is_none")] - pub default_instance_type: Option, - #[doc = "Instance Type Schema"] - #[serde(rename = "instanceTypes", default, skip_serializing_if = "Option::is_none")] - pub instance_types: Option, -} -impl KubernetesProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Kubernetes Compute Schema"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KubernetesSchema { - #[doc = "Kubernetes properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl KubernetesSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label category definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelCategory { - #[doc = "Dictionary of label classes in this category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub classes: Option, - #[doc = "Display name of the label category."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Whether multiSelect is enabled"] - #[serde(rename = "multiSelect", default, skip_serializing_if = "Option::is_none")] - pub multi_select: Option, -} -impl LabelCategory { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label class definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelClass { - #[doc = "Display name of the label class."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Dictionary of subclasses of the label class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subclasses: Option, -} -impl LabelClass { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling data configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingDataConfiguration { - #[doc = "Resource Id of the data asset to perform labeling."] - #[serde(rename = "dataId", default, skip_serializing_if = "Option::is_none")] - pub data_id: Option, - #[doc = "Whether IncrementalDataRefresh is enabled"] - #[serde(rename = "incrementalDataRefresh", default, skip_serializing_if = "Option::is_none")] - pub incremental_data_refresh: Option, -} -impl LabelingDataConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling job definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Created time of the job in UTC timezone."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[doc = "Labeling data configuration definition"] - #[serde(rename = "dataConfiguration", default, skip_serializing_if = "Option::is_none")] - pub data_configuration: Option, - #[doc = "Instructions for labeling job"] - #[serde(rename = "jobInstructions", default, skip_serializing_if = "Option::is_none")] - pub job_instructions: Option, - #[doc = "Label categories of the job."] - #[serde(rename = "labelCategories", default, skip_serializing_if = "Option::is_none")] - pub label_categories: Option, - #[doc = "Properties of a labeling job"] - #[serde(rename = "labelingJobMediaProperties", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_media_properties: Option, - #[doc = "Labeling MLAssist configuration definition"] - #[serde(rename = "mlAssistConfiguration", default, skip_serializing_if = "Option::is_none")] - pub ml_assist_configuration: Option, - #[doc = "Progress metrics definition"] - #[serde(rename = "progressMetrics", default, skip_serializing_if = "Option::is_none")] - pub progress_metrics: Option, - #[doc = "Internal id of the job(Previously called project)."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option, - #[doc = "Enum to determine the job provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Status messages of the job."] - #[serde( - rename = "statusMessages", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub status_messages: Vec, -} -impl LabelingJob { - pub fn new(job_base: JobBase) -> Self { - Self { - job_base, - created_date_time: None, - data_configuration: None, - job_instructions: None, - label_categories: None, - labeling_job_media_properties: None, - ml_assist_configuration: None, - progress_metrics: None, - project_id: None, - provisioning_state: None, - status_messages: Vec::new(), - } - } -} -#[doc = "Properties of a labeling job for image data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobImageProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of image data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobImageProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[doc = "Instructions for labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobInstructions { - #[doc = "The link to a page with detailed labeling instructions for labelers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, -} -impl LabelingJobInstructions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobMediaProperties { - #[doc = "Media type of data asset."] - #[serde(rename = "mediaType")] - pub media_type: MediaType, -} -impl LabelingJobMediaProperties { - pub fn new(media_type: MediaType) -> Self { - Self { media_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mediaType")] -pub enum LabelingJobMediaPropertiesUnion { - Image(LabelingJobImageProperties), - Text(LabelingJobTextProperties), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Labeling job definition"] - pub properties: LabelingJob, -} -impl LabelingJobResource { - pub fn new(properties: LabelingJob) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of LabelingJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobResourceArmPaginatedResult { - #[doc = "The link to the next page of LabelingJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type LabelingJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for LabelingJobResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl LabelingJobResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job for text data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobTextProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of text data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobTextProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[doc = "Learning rate scheduler enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LearningRateScheduler")] -pub enum LearningRateScheduler { - None, - WarmupCosine, - Step, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("LearningRateScheduler", 0u32, "None"), - Self::WarmupCosine => serializer.serialize_unit_variant("LearningRateScheduler", 1u32, "WarmupCosine"), - Self::Step => serializer.serialize_unit_variant("LearningRateScheduler", 2u32, "Step"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The List Aml user feature operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListAmlUserFeatureResult { - #[doc = "The list of AML user facing features."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListAmlUserFeatureResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListAmlUserFeatureResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListNotebookKeysResult { - #[serde(rename = "primaryAccessKey", default, skip_serializing_if = "Option::is_none")] - pub primary_access_key: Option, - #[serde(rename = "secondaryAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secondary_access_key: Option, -} -impl ListNotebookKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListStorageAccountKeysResult { - #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] - pub user_storage_key: Option, -} -impl ListStorageAccountKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List Usages operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListUsagesResult { - #[doc = "The list of AML resource usages."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListUsagesResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListUsagesResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ListViewType")] -pub enum ListViewType { - ActiveOnly, - ArchivedOnly, - All, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ListViewType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ListViewType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ListViewType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ActiveOnly => serializer.serialize_unit_variant("ListViewType", 0u32, "ActiveOnly"), - Self::ArchivedOnly => serializer.serialize_unit_variant("ListViewType", 1u32, "ArchivedOnly"), - Self::All => serializer.serialize_unit_variant("ListViewType", 2u32, "All"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListWorkspaceKeysResult { - #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] - pub user_storage_key: Option, - #[serde(rename = "userStorageResourceId", default, skip_serializing_if = "Option::is_none")] - pub user_storage_resource_id: Option, - #[serde(rename = "appInsightsInstrumentationKey", default, skip_serializing_if = "Option::is_none")] - pub app_insights_instrumentation_key: Option, - #[serde(rename = "containerRegistryCredentials", default, skip_serializing_if = "Option::is_none")] - pub container_registry_credentials: Option, - #[serde(rename = "notebookAccessKeys", default, skip_serializing_if = "Option::is_none")] - pub notebook_access_keys: Option, -} -impl ListWorkspaceKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List WorkspaceQuotasByVMFamily operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListWorkspaceQuotas { - #[doc = "The list of Workspace Quotas by VM Family"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListWorkspaceQuotas { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListWorkspaceQuotas { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Literal input type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LiteralJobInput { - #[serde(flatten)] - pub job_input: JobInput, - #[doc = "[Required] Literal value for the input."] - pub value: String, -} -impl LiteralJobInput { - pub fn new(job_input: JobInput, value: String) -> Self { - Self { job_input, value } - } -} -#[doc = "Enum for setting log verbosity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LogVerbosity")] -pub enum LogVerbosity { - NotSet, - Debug, - Info, - Warning, - Error, - Critical, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LogVerbosity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LogVerbosity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LogVerbosity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotSet => serializer.serialize_unit_variant("LogVerbosity", 0u32, "NotSet"), - Self::Debug => serializer.serialize_unit_variant("LogVerbosity", 1u32, "Debug"), - Self::Info => serializer.serialize_unit_variant("LogVerbosity", 2u32, "Info"), - Self::Warning => serializer.serialize_unit_variant("LogVerbosity", 3u32, "Warning"), - Self::Error => serializer.serialize_unit_variant("LogVerbosity", 4u32, "Error"), - Self::Critical => serializer.serialize_unit_variant("LogVerbosity", 5u32, "Critical"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Labeling MLAssist configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfiguration { - #[serde(rename = "mlAssist")] - pub ml_assist: MlAssistConfigurationType, -} -impl MlAssistConfiguration { - pub fn new(ml_assist: MlAssistConfigurationType) -> Self { - Self { ml_assist } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mlAssist")] -pub enum MlAssistConfigurationUnion { - Disabled(MlAssistConfigurationDisabled), - Enabled(MlAssistConfigurationEnabled), -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is disabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationDisabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, -} -impl MlAssistConfigurationDisabled { - pub fn new(ml_assist_configuration: MlAssistConfiguration) -> Self { - Self { ml_assist_configuration } - } -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationEnabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, - #[doc = "[Required] AML compute binding used in inferencing."] - #[serde(rename = "inferencingComputeBinding")] - pub inferencing_compute_binding: String, - #[doc = "[Required] AML compute binding used in training."] - #[serde(rename = "trainingComputeBinding")] - pub training_compute_binding: String, -} -impl MlAssistConfigurationEnabled { - pub fn new( - ml_assist_configuration: MlAssistConfiguration, - inferencing_compute_binding: String, - training_compute_binding: String, - ) -> Self { - Self { - ml_assist_configuration, - inferencing_compute_binding, - training_compute_binding, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlAssistConfigurationType")] -pub enum MlAssistConfigurationType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlAssistConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlAssistConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlAssistConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the state of mlflow autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlFlowAutologgerState")] -pub enum MlFlowAutologgerState { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlFlowAutologgerState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlFlowAutologgerState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlFlowAutologgerState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlFlowModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl MlFlowModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlFlowModelJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl MlFlowModelJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "MLTable data definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableData { - #[serde(flatten)] - pub data_version_base: DataVersionBase, - #[doc = "Uris referenced in the MLTable definition (required for lineage)"] - #[serde( - rename = "referencedUris", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub referenced_uris: Vec, -} -impl MlTableData { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { - data_version_base, - referenced_uris: Vec::new(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl MlTableJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl MlTableJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "Managed identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedIdentity { - #[serde(flatten)] - pub identity_configuration: IdentityConfiguration, - #[doc = "Specifies a user-assigned identity by client ID. For system-assigned, do not set this field."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[doc = "Specifies a user-assigned identity by object ID. For system-assigned, do not set this field."] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option, - #[doc = "Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not set this field."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl ManagedIdentity { - pub fn new(identity_configuration: IdentityConfiguration) -> Self { - Self { - identity_configuration, - client_id: None, - object_id: None, - resource_id: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedIdentityAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ManagedIdentityAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Properties specific to a ManagedOnlineDeployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedOnlineDeployment { - #[serde(flatten)] - pub online_deployment: OnlineDeployment, -} -impl ManagedOnlineDeployment { - pub fn new(online_deployment: OnlineDeployment) -> Self { - Self { online_deployment } - } -} -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedServiceIdentity { - #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] - #[serde(rename = "type")] - pub type_: ManagedServiceIdentityType, - #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] - #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identities: Option, -} -impl ManagedServiceIdentity { - pub fn new(type_: ManagedServiceIdentityType) -> Self { - Self { - principal_id: None, - tenant_id: None, - type_, - user_assigned_identities: None, - } - } -} -#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ManagedServiceIdentityType")] -pub enum ManagedServiceIdentityType { - None, - SystemAssigned, - UserAssigned, - #[serde(rename = "SystemAssigned,UserAssigned")] - SystemAssignedUserAssigned, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ManagedServiceIdentityType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ManagedServiceIdentityType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ManagedServiceIdentityType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), - Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), - Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), - Self::SystemAssignedUserAssigned => { - serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned,UserAssigned") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Dto object representing compute resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MaterializationComputeResource { - #[doc = "Specifies the instance type"] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, -} -impl MaterializationComputeResource { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MaterializationSettings { - #[doc = "Configuration for notification."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub notification: Option, - #[doc = "Dto object representing compute resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, - #[doc = "Specifies the spark compute settings"] - #[serde(rename = "sparkConfiguration", default, skip_serializing_if = "Option::is_none")] - pub spark_configuration: Option, - #[serde(rename = "storeType", default, skip_serializing_if = "Option::is_none")] - pub store_type: Option, -} -impl MaterializationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MaterializationStoreType")] -pub enum MaterializationStoreType { - None, - Online, - Offline, - OnlineAndOffline, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MaterializationStoreType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MaterializationStoreType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MaterializationStoreType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("MaterializationStoreType", 0u32, "None"), - Self::Online => serializer.serialize_unit_variant("MaterializationStoreType", 1u32, "Online"), - Self::Offline => serializer.serialize_unit_variant("MaterializationStoreType", 2u32, "Offline"), - Self::OnlineAndOffline => serializer.serialize_unit_variant("MaterializationStoreType", 3u32, "OnlineAndOffline"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Media type of data asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MediaType")] -pub enum MediaType { - Image, - Text, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MediaType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MediaType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MediaType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Image => serializer.serialize_unit_variant("MediaType", 0u32, "Image"), - Self::Text => serializer.serialize_unit_variant("MediaType", 1u32, "Text"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Defines an early termination policy based on running averages of the primary metric of all runs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MedianStoppingPolicy { - #[serde(flatten)] - pub early_termination_policy: EarlyTerminationPolicy, -} -impl MedianStoppingPolicy { - pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { - Self { early_termination_policy } - } -} -#[doc = "Model configuration options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelConfiguration { - #[doc = "Mounting type of the model or the inputs"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Relative mounting path of the model in the target image."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, -} -impl ModelConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl ModelContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelContainerResource { - #[serde(flatten)] - pub resource: Resource, - pub properties: ModelContainer, -} -impl ModelContainerResource { - pub fn new(properties: ModelContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ModelContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of ModelContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ModelContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ModelContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ModelContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model package input options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelPackageInput { - #[doc = "Type of the inputs."] - #[serde(rename = "inputType")] - pub input_type: PackageInputType, - #[doc = "Mounting type of the model or the inputs"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Relative mount path of the input in the target image."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, - pub path: PackageInputPathBaseUnion, -} -impl ModelPackageInput { - pub fn new(input_type: PackageInputType, path: PackageInputPathBaseUnion) -> Self { - Self { - input_type, - mode: None, - mount_path: None, - path, - } - } -} -#[doc = "Image model size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ModelSize")] -pub enum ModelSize { - None, - Small, - Medium, - Large, - ExtraLarge, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ModelSize { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ModelSize { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ModelSize { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ModelSize", 0u32, "None"), - Self::Small => serializer.serialize_unit_variant("ModelSize", 1u32, "Small"), - Self::Medium => serializer.serialize_unit_variant("ModelSize", 2u32, "Medium"), - Self::Large => serializer.serialize_unit_variant("ModelSize", 3u32, "Large"), - Self::ExtraLarge => serializer.serialize_unit_variant("ModelSize", 4u32, "ExtraLarge"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Model asset version details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Mapping of model flavors to their properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flavors: Option, - #[doc = "Name of the training job which produced this model"] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option, - #[doc = "The storage format for this entity. Used for NCD."] - #[serde(rename = "modelType", default, skip_serializing_if = "Option::is_none")] - pub model_type: Option, - #[doc = "The URI path to the model contents."] - #[serde(rename = "modelUri", default, skip_serializing_if = "Option::is_none")] - pub model_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl ModelVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Model asset version details."] - pub properties: ModelVersion, -} -impl ModelVersionResource { - pub fn new(properties: ModelVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ModelVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of ModelVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ModelVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ModelVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ModelVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "MPI distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Mpi { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of processes per MPI node."] - #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] - pub process_count_per_instance: Option, -} -impl Mpi { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - process_count_per_instance: None, - } - } -} -#[doc = "Whether multiSelect is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MultiSelect")] -pub enum MultiSelect { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MultiSelect { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MultiSelect { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MultiSelect { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MultiSelect", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MultiSelect", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "N-Cross validations value."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NCrossValidations { - #[doc = "Determines how N-Cross validations value is determined."] - pub mode: NCrossValidationsMode, -} -impl NCrossValidations { - pub fn new(mode: NCrossValidationsMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum NCrossValidationsUnion { - Auto(AutoNCrossValidations), - Custom(CustomNCrossValidations), -} -#[doc = "Determines how N-Cross validations value is determined."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NCrossValidationsMode")] -pub enum NCrossValidationsMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NCrossValidationsMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NCrossValidationsMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NCrossValidationsMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("NCrossValidationsMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("NCrossValidationsMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpFixedParameters { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NlpLearningRateScheduler")] -pub enum NlpLearningRateScheduler { - None, - Linear, - Cosine, - CosineWithRestarts, - Polynomial, - Constant, - ConstantWithWarmup, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NlpLearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NlpLearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NlpLearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("NlpLearningRateScheduler", 0u32, "None"), - Self::Linear => serializer.serialize_unit_variant("NlpLearningRateScheduler", 1u32, "Linear"), - Self::Cosine => serializer.serialize_unit_variant("NlpLearningRateScheduler", 2u32, "Cosine"), - Self::CosineWithRestarts => serializer.serialize_unit_variant("NlpLearningRateScheduler", 3u32, "CosineWithRestarts"), - Self::Polynomial => serializer.serialize_unit_variant("NlpLearningRateScheduler", 4u32, "Polynomial"), - Self::Constant => serializer.serialize_unit_variant("NlpLearningRateScheduler", 5u32, "Constant"), - Self::ConstantWithWarmup => serializer.serialize_unit_variant("NlpLearningRateScheduler", 6u32, "ConstantWithWarmup"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stringified search spaces for each parameter. See below examples."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpParameterSubspace { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "The type of learning rate schedule to use during the training procedure."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model sweeping and hyperparameter tuning related settings."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NlpSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl NlpSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for NLP related AutoML tasks.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVertical { - #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] - pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, - #[doc = "Job execution constraints."] - #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] - pub limit_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[doc = "Model sweeping and hyperparameter tuning related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, -} -impl NlpVertical { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVerticalFeaturizationSettings { - #[serde(flatten)] - pub featurization_settings: FeaturizationSettings, -} -impl NlpVerticalFeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Job execution constraints."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVerticalLimitSettings { - #[doc = "Maximum Concurrent AutoML iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, - #[doc = "Number of AutoML iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[doc = "Timeout for individual HD trials."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl NlpVerticalLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Counts of various compute node states on the amlCompute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NodeStateCounts { - #[doc = "Number of compute nodes in idle state."] - #[serde(rename = "idleNodeCount", default, skip_serializing_if = "Option::is_none")] - pub idle_node_count: Option, - #[doc = "Number of compute nodes which are running jobs."] - #[serde(rename = "runningNodeCount", default, skip_serializing_if = "Option::is_none")] - pub running_node_count: Option, - #[doc = "Number of compute nodes which are being prepared."] - #[serde(rename = "preparingNodeCount", default, skip_serializing_if = "Option::is_none")] - pub preparing_node_count: Option, - #[doc = "Number of compute nodes which are in unusable state."] - #[serde(rename = "unusableNodeCount", default, skip_serializing_if = "Option::is_none")] - pub unusable_node_count: Option, - #[doc = "Number of compute nodes which are leaving the amlCompute."] - #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] - pub leaving_node_count: Option, - #[doc = "Number of compute nodes which are in preempted state."] - #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] - pub preempted_node_count: Option, -} -impl NodeStateCounts { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Abstract Nodes definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Nodes { - #[doc = "The enumerated types for the nodes value"] - #[serde(rename = "nodesValueType")] - pub nodes_value_type: NodesValueType, -} -impl Nodes { - pub fn new(nodes_value_type: NodesValueType) -> Self { - Self { nodes_value_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "nodesValueType")] -pub enum NodesUnion { - All(AllNodes), -} -#[doc = "The enumerated types for the nodes value"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NodesValueType")] -pub enum NodesValueType { - All, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NodesValueType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NodesValueType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NodesValueType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::All => serializer.serialize_unit_variant("NodesValueType", 0u32, "All"), - Self::Custom => serializer.serialize_unit_variant("NodesValueType", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NoneAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, -} -impl NoneAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - } - } -} -#[doc = "Empty/none datastore credentials."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NoneDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, -} -impl NoneDatastoreCredentials { - pub fn new(datastore_credentials: DatastoreCredentials) -> Self { - Self { datastore_credentials } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookAccessTokenResult { - #[serde(rename = "notebookResourceId", default, skip_serializing_if = "Option::is_none")] - pub notebook_resource_id: Option, - #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] - pub host_name: Option, - #[serde(rename = "publicDns", default, skip_serializing_if = "Option::is_none")] - pub public_dns: Option, - #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option, - #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] - pub expires_in: Option, - #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] - pub refresh_token: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, -} -impl NotebookAccessTokenResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookPreparationError { - #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[serde(rename = "statusCode", default, skip_serializing_if = "Option::is_none")] - pub status_code: Option, -} -impl NotebookPreparationError { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookResourceInfo { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fqdn: Option, - #[doc = "the data plane resourceId that used to initialize notebook component"] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, - #[serde(rename = "notebookPreparationError", default, skip_serializing_if = "Option::is_none")] - pub notebook_preparation_error: Option, -} -impl NotebookResourceInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration for notification."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotificationSetting { - #[doc = "Send email notification to user on specified notification type"] - #[serde( - rename = "emailOn", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub email_on: Vec, - #[doc = "This is the email recipient list which has a limitation of 499 characters in total concat with comma separator"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub emails: Vec, -} -impl NotificationSetting { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Primary metrics for Image ObjectDetection task."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ObjectDetectionPrimaryMetrics")] -pub enum ObjectDetectionPrimaryMetrics { - MeanAveragePrecision, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ObjectDetectionPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ObjectDetectionPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ObjectDetectionPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAveragePrecision => serializer.serialize_unit_variant("ObjectDetectionPrimaryMetrics", 0u32, "MeanAveragePrecision"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Optimization objective."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Objective { - #[doc = "Defines supported metric goals for hyperparameter tuning"] - pub goal: Goal, - #[doc = "[Required] Name of the metric to optimize."] - #[serde(rename = "primaryMetric")] - pub primary_metric: String, -} -impl Objective { - pub fn new(goal: Goal, primary_metric: String) -> Self { - Self { goal, primary_metric } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineDeployment { - #[serde(flatten)] - pub endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase, - #[doc = "If true, enables Application Insights logging."] - #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] - pub app_insights_enabled: Option, - #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment."] - #[serde(rename = "egressPublicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub egress_public_network_access: Option, - #[doc = "Enum to determine endpoint compute type."] - #[serde(rename = "endpointComputeType")] - pub endpoint_compute_type: EndpointComputeType, - #[doc = "Compute instance type."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Deployment container liveness/readiness probe configuration."] - #[serde(rename = "livenessProbe", default, skip_serializing_if = "Option::is_none")] - pub liveness_probe: Option, - #[doc = "The URI path to the model."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, - #[doc = "The path to mount the model in custom container."] - #[serde(rename = "modelMountPath", default, skip_serializing_if = "Option::is_none")] - pub model_mount_path: Option, - #[doc = "Possible values for DeploymentProvisioningState."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Deployment container liveness/readiness probe configuration."] - #[serde(rename = "readinessProbe", default, skip_serializing_if = "Option::is_none")] - pub readiness_probe: Option, - #[doc = "Online deployment scoring requests configuration."] - #[serde(rename = "requestSettings", default, skip_serializing_if = "Option::is_none")] - pub request_settings: Option, - #[doc = "Online deployment scaling configuration."] - #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, -} -impl OnlineDeployment { - pub fn new(endpoint_compute_type: EndpointComputeType) -> Self { - Self { - endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase::default(), - app_insights_enabled: None, - egress_public_network_access: None, - endpoint_compute_type, - instance_type: None, - liveness_probe: None, - model: None, - model_mount_path: None, - provisioning_state: None, - readiness_probe: None, - request_settings: None, - scale_settings: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "endpointComputeType")] -pub enum OnlineDeploymentUnion { - Kubernetes(KubernetesOnlineDeployment), - Managed(ManagedOnlineDeployment), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineDeploymentTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - pub properties: OnlineDeploymentUnion, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl OnlineDeploymentTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: OnlineDeploymentUnion) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of OnlineDeployment entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineDeploymentTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of OnlineDeployment objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type OnlineDeployment."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for OnlineDeploymentTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OnlineDeploymentTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online endpoint configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineEndpoint { - #[serde(flatten)] - pub endpoint_properties_base: EndpointPropertiesBase, - #[doc = "ARM resource ID of the compute if it exists.\r\noptional"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compute: Option, - #[doc = "Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50."] - #[serde(rename = "mirrorTraffic", default, skip_serializing_if = "Option::is_none")] - pub mirror_traffic: Option, - #[doc = "State of endpoint provisioning."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub traffic: Option, -} -impl OnlineEndpoint { - pub fn new(endpoint_properties_base: EndpointPropertiesBase) -> Self { - Self { - endpoint_properties_base, - compute: None, - mirror_traffic: None, - provisioning_state: None, - public_network_access: None, - traffic: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineEndpointTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Online endpoint configuration"] - pub properties: OnlineEndpoint, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl OnlineEndpointTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: OnlineEndpoint) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of OnlineEndpoint entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineEndpointTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of OnlineEndpoint objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type OnlineEndpoint."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for OnlineEndpointTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OnlineEndpointTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online inference configuration options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineInferenceConfiguration { - #[doc = "Additional configurations"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configurations: Option, - #[doc = "Entry script or command to invoke."] - #[serde(rename = "entryScript", default, skip_serializing_if = "Option::is_none")] - pub entry_script: Option, - #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] - pub liveness_route: Option, - #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] - pub readiness_route: Option, - #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] - pub scoring_route: Option, -} -impl OnlineInferenceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online deployment scoring requests configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineRequestSettings { - #[doc = "The number of maximum concurrent requests per node allowed per deployment. Defaults to 1."] - #[serde(rename = "maxConcurrentRequestsPerInstance", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_requests_per_instance: Option, - #[doc = "The maximum amount of time a request will stay in the queue in ISO 8601 format.\r\nDefaults to 500ms."] - #[serde(rename = "maxQueueWait", default, skip_serializing_if = "Option::is_none")] - pub max_queue_wait: Option, - #[doc = "The scoring timeout in ISO 8601 format.\r\nDefaults to 5000ms."] - #[serde(rename = "requestTimeout", default, skip_serializing_if = "Option::is_none")] - pub request_timeout: Option, -} -impl OnlineRequestSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online deployment scaling configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineScaleSettings { - #[serde(rename = "scaleType")] - pub scale_type: ScaleType, -} -impl OnlineScaleSettings { - pub fn new(scale_type: ScaleType) -> Self { - Self { scale_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "scaleType")] -pub enum OnlineScaleSettingsUnion { - Default(DefaultScaleSettings), - TargetUtilization(TargetUtilizationScaleSettings), -} -#[doc = "The type of operating system."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OperatingSystemType")] -pub enum OperatingSystemType { - Linux, - Windows, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OperatingSystemType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OperatingSystemType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OperatingSystemType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Linux => serializer.serialize_unit_variant("OperatingSystemType", 0u32, "Linux"), - Self::Windows => serializer.serialize_unit_variant("OperatingSystemType", 1u32, "Windows"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OrderString")] -pub enum OrderString { - CreatedAtDesc, - CreatedAtAsc, - UpdatedAtDesc, - UpdatedAtAsc, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OrderString { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OrderString { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OrderString { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreatedAtDesc => serializer.serialize_unit_variant("OrderString", 0u32, "CreatedAtDesc"), - Self::CreatedAtAsc => serializer.serialize_unit_variant("OrderString", 1u32, "CreatedAtAsc"), - Self::UpdatedAtDesc => serializer.serialize_unit_variant("OrderString", 2u32, "UpdatedAtDesc"), - Self::UpdatedAtAsc => serializer.serialize_unit_variant("OrderString", 3u32, "UpdatedAtAsc"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Output data delivery mode enums."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OutputDeliveryMode")] -pub enum OutputDeliveryMode { - ReadWriteMount, - Upload, - Direct, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OutputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OutputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OutputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadWriteMount => serializer.serialize_unit_variant("OutputDeliveryMode", 0u32, "ReadWriteMount"), - Self::Upload => serializer.serialize_unit_variant("OutputDeliveryMode", 1u32, "Upload"), - Self::Direct => serializer.serialize_unit_variant("OutputDeliveryMode", 2u32, "Direct"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Reference to an asset via its path in a job output."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutputPathAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "ARM resource ID of the job."] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "The path of the file/directory in the job output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl OutputPathAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase) -> Self { - Self { - asset_reference_base, - job_id: None, - path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl PatAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Package build state returned in package response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageBuildState")] -pub enum PackageBuildState { - NotStarted, - Running, - Succeeded, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageBuildState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageBuildState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageBuildState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotStarted => serializer.serialize_unit_variant("PackageBuildState", 0u32, "NotStarted"), - Self::Running => serializer.serialize_unit_variant("PackageBuildState", 1u32, "Running"), - Self::Succeeded => serializer.serialize_unit_variant("PackageBuildState", 2u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("PackageBuildState", 3u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Mounting type of the model or the inputs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageInputDeliveryMode")] -pub enum PackageInputDeliveryMode { - ReadOnlyMount, - Download, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageInputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageInputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageInputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadOnlyMount => serializer.serialize_unit_variant("PackageInputDeliveryMode", 0u32, "ReadOnlyMount"), - Self::Download => serializer.serialize_unit_variant("PackageInputDeliveryMode", 1u32, "Download"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathBase { - #[doc = "Input path type for package inputs."] - #[serde(rename = "inputPathType")] - pub input_path_type: InputPathType, -} -impl PackageInputPathBase { - pub fn new(input_path_type: InputPathType) -> Self { - Self { input_path_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "inputPathType")] -pub enum PackageInputPathBaseUnion { - PathId(PackageInputPathId), - Url(PackageInputPathUrl), - PathVersion(PackageInputPathVersion), -} -#[doc = "Package input path specified with a resource id."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathId { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input resource id."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl PackageInputPathId { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - resource_id: None, - } - } -} -#[doc = "Package input path specified as an url."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathUrl { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input path url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, -} -impl PackageInputPathUrl { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - url: None, - } - } -} -#[doc = "Package input path specified with name and version."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathVersion { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input resource name."] - #[serde(rename = "resourceName", default, skip_serializing_if = "Option::is_none")] - pub resource_name: Option, - #[doc = "Input resource version."] - #[serde(rename = "resourceVersion", default, skip_serializing_if = "Option::is_none")] - pub resource_version: Option, -} -impl PackageInputPathVersion { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - resource_name: None, - resource_version: None, - } - } -} -#[doc = "Type of the inputs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageInputType")] -pub enum PackageInputType { - UriFile, - UriFolder, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageInputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageInputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageInputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("PackageInputType", 0u32, "UriFile"), - Self::UriFolder => serializer.serialize_unit_variant("PackageInputType", 1u32, "UriFolder"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Model package operation request properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageRequest { - #[serde(rename = "baseEnvironmentSource", default, skip_serializing_if = "Option::is_none")] - pub base_environment_source: Option, - #[doc = "Collection of environment variables."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(rename = "inferencingServer")] - pub inferencing_server: InferencingServerUnion, - #[doc = "Collection of inputs."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub inputs: Vec, - #[doc = "Model configuration options."] - #[serde(rename = "modelConfiguration", default, skip_serializing_if = "Option::is_none")] - pub model_configuration: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "[Required] Target environment name to be generated by package."] - #[serde(rename = "targetEnvironmentName")] - pub target_environment_name: String, - #[doc = "Target environment version to be generated by package."] - #[serde(rename = "targetEnvironmentVersion", default, skip_serializing_if = "Option::is_none")] - pub target_environment_version: Option, -} -impl PackageRequest { - pub fn new(inferencing_server: InferencingServerUnion, target_environment_name: String) -> Self { - Self { - base_environment_source: None, - environment_variables: None, - inferencing_server, - inputs: Vec::new(), - model_configuration: None, - tags: None, - target_environment_name, - target_environment_version: None, - } - } -} -#[doc = "Package response returned after async package operation completes successfully."] +#[doc = "Model asset version details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PackageResponse { - #[serde(rename = "baseEnvironmentSource", default, skip_serializing_if = "Option::is_none")] - pub base_environment_source: Option, - #[doc = "Build id of the image build operation."] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option, - #[doc = "Package build state returned in package response."] - #[serde(rename = "buildState", default, skip_serializing_if = "Option::is_none")] - pub build_state: Option, - #[doc = "Collection of environment variables."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(rename = "inferencingServer", default, skip_serializing_if = "Option::is_none")] - pub inferencing_server: Option, - #[doc = "Collection of inputs."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub inputs: Vec, - #[doc = "Log url of the image build operation."] - #[serde(rename = "logUrl", default, skip_serializing_if = "Option::is_none")] - pub log_url: Option, - #[doc = "Model configuration options."] - #[serde(rename = "modelConfiguration", default, skip_serializing_if = "Option::is_none")] - pub model_configuration: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] +pub struct ModelVersion { + #[serde(flatten)] + pub asset_base: AssetBase, + #[doc = "Mapping of model flavors to their properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "Asset ID of the target environment created by package operation."] - #[serde(rename = "targetEnvironmentId", default, skip_serializing_if = "Option::is_none")] - pub target_environment_id: Option, - #[doc = "Target environment name to be generated by package."] - #[serde(rename = "targetEnvironmentName", default, skip_serializing_if = "Option::is_none")] - pub target_environment_name: Option, - #[doc = "Target environment version to be generated by package."] - #[serde(rename = "targetEnvironmentVersion", default, skip_serializing_if = "Option::is_none")] - pub target_environment_version: Option, -} -impl PackageResponse { + pub flavors: Option, + #[doc = "Name of the training job which produced this model"] + #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] + pub job_name: Option, + #[doc = "The storage format for this entity. Used for NCD."] + #[serde(rename = "modelType", default, skip_serializing_if = "Option::is_none")] + pub model_type: Option, + #[doc = "The URI path to the model contents."] + #[serde(rename = "modelUri", default, skip_serializing_if = "Option::is_none")] + pub model_uri: Option, +} +impl ModelVersion { pub fn new() -> Self { Self::default() } } -#[doc = "Paginated list of Machine Learning compute objects wrapped in ARM resource envelope."] +#[doc = "Azure Resource Manager resource envelope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ModelVersionResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Model asset version details."] + pub properties: ModelVersion, +} +impl ModelVersionResource { + pub fn new(properties: ModelVersion) -> Self { + Self { + resource: Resource::default(), + properties, + } + } +} +#[doc = "A paginated list of ModelVersion entities."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PaginatedComputeResourcesList { - #[doc = "An array of Machine Learning compute objects wrapped in ARM resource envelope."] +pub struct ModelVersionResourceArmPaginatedResult { + #[doc = "The link to the next page of ModelVersion objects. If null, there are no additional pages."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "An array of objects of type ModelVersion."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, - #[doc = "A continuation link (absolute URI) to the next page of results in the list."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, + pub value: Vec, } -impl azure_core::Continuable for PaginatedComputeResourcesList { +impl azure_core::Continuable for ModelVersionResourceArmPaginatedResult { type Continuation = String; fn continuation(&self) -> Option { self.next_link.clone().filter(|value| !value.is_empty()) } } -impl PaginatedComputeResourcesList { +impl ModelVersionResourceArmPaginatedResult { pub fn new() -> Self { Self::default() } } -#[doc = "Mutable batch inference settings per deployment."] +#[doc = "MPI distribution configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Mpi { + #[serde(flatten)] + pub distribution_configuration: DistributionConfiguration, + #[doc = "Number of processes per MPI node."] + #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] + pub process_count_per_instance: Option, +} +impl Mpi { + pub fn new(distribution_configuration: DistributionConfiguration) -> Self { + Self { + distribution_configuration, + process_count_per_instance: None, + } + } +} +#[doc = "Counts of various compute node states on the amlCompute."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialBatchDeployment { - #[doc = "Description of the endpoint deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, +pub struct NodeStateCounts { + #[doc = "Number of compute nodes in idle state."] + #[serde(rename = "idleNodeCount", default, skip_serializing_if = "Option::is_none")] + pub idle_node_count: Option, + #[doc = "Number of compute nodes which are running jobs."] + #[serde(rename = "runningNodeCount", default, skip_serializing_if = "Option::is_none")] + pub running_node_count: Option, + #[doc = "Number of compute nodes which are being prepared."] + #[serde(rename = "preparingNodeCount", default, skip_serializing_if = "Option::is_none")] + pub preparing_node_count: Option, + #[doc = "Number of compute nodes which are in unusable state."] + #[serde(rename = "unusableNodeCount", default, skip_serializing_if = "Option::is_none")] + pub unusable_node_count: Option, + #[doc = "Number of compute nodes which are leaving the amlCompute."] + #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] + pub leaving_node_count: Option, + #[doc = "Number of compute nodes which are in preempted state."] + #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] + pub preempted_node_count: Option, } -impl PartialBatchDeployment { +impl NodeStateCounts { pub fn new() -> Self { Self::default() } } -#[doc = "Strictly used in update requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NoneAuthTypeWorkspaceConnectionProperties { + #[serde(flatten)] + pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, +} +impl NoneAuthTypeWorkspaceConnectionProperties { + pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { + Self { + workspace_connection_properties_v2, + } + } +} +#[doc = "Empty/none datastore credentials."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NoneDatastoreCredentials { + #[serde(flatten)] + pub datastore_credentials: DatastoreCredentials, +} +impl NoneDatastoreCredentials { + pub fn new(datastore_credentials: DatastoreCredentials) -> Self { + Self { datastore_credentials } + } +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { - #[doc = "Mutable batch inference settings per deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Resource tags."] +pub struct NotebookAccessTokenResult { + #[serde(rename = "notebookResourceId", default, skip_serializing_if = "Option::is_none")] + pub notebook_resource_id: Option, + #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] + pub host_name: Option, + #[serde(rename = "publicDns", default, skip_serializing_if = "Option::is_none")] + pub public_dns: Option, + #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] + pub access_token: Option, + #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] + pub token_type: Option, + #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] + pub expires_in: Option, + #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, + pub scope: Option, } -impl PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { +impl NotebookAccessTokenResult { pub fn new() -> Self { Self::default() } } -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialManagedServiceIdentity { - #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] - #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identities: Option, +pub struct NotebookPreparationError { + #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "statusCode", default, skip_serializing_if = "Option::is_none")] + pub status_code: Option, } -impl PartialManagedServiceIdentity { +impl NotebookPreparationError { pub fn new() -> Self { Self::default() } } -#[doc = "Strictly used in update requests."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResource { - #[doc = "Resource tags."] +pub struct NotebookResourceInfo { #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, + pub fqdn: Option, + #[doc = "the data plane resourceId that used to initialize notebook component"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[serde(rename = "notebookPreparationError", default, skip_serializing_if = "Option::is_none")] + pub notebook_preparation_error: Option, } -impl PartialMinimalTrackedResource { +impl NotebookResourceInfo { pub fn new() -> Self { Self::default() } } -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResourceWithIdentity { - #[serde(flatten)] - pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, +#[doc = "Optimization objective."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Objective { + #[doc = "Defines supported metric goals for hyperparameter tuning"] + pub goal: Goal, + #[doc = "[Required] Name of the metric to optimize."] + #[serde(rename = "primaryMetric")] + pub primary_metric: String, } -impl PartialMinimalTrackedResourceWithIdentity { - pub fn new() -> Self { - Self::default() +impl Objective { + pub fn new(goal: Goal, primary_metric: String) -> Self { + Self { goal, primary_metric } } } -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResourceWithSku { +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OnlineDeployment { #[serde(flatten)] - pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, - #[doc = "Common SKU definition."] + pub endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase, + #[doc = "If true, enables Application Insights logging."] + #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] + pub app_insights_enabled: Option, + #[doc = "Enum to determine endpoint compute type."] + #[serde(rename = "endpointComputeType")] + pub endpoint_compute_type: EndpointComputeType, + #[doc = "Compute instance type."] + #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] + pub instance_type: Option, + #[doc = "Deployment container liveness/readiness probe configuration."] + #[serde(rename = "livenessProbe", default, skip_serializing_if = "Option::is_none")] + pub liveness_probe: Option, + #[doc = "The URI path to the model."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, + pub model: Option, + #[doc = "The path to mount the model in custom container."] + #[serde(rename = "modelMountPath", default, skip_serializing_if = "Option::is_none")] + pub model_mount_path: Option, + #[doc = "Possible values for DeploymentProvisioningState."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Deployment container liveness/readiness probe configuration."] + #[serde(rename = "readinessProbe", default, skip_serializing_if = "Option::is_none")] + pub readiness_probe: Option, + #[doc = "Online deployment scoring requests configuration."] + #[serde(rename = "requestSettings", default, skip_serializing_if = "Option::is_none")] + pub request_settings: Option, + #[doc = "Online deployment scaling configuration."] + #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] + pub scale_settings: Option, } -impl PartialMinimalTrackedResourceWithSku { - pub fn new() -> Self { - Self::default() +impl OnlineDeployment { + pub fn new(endpoint_compute_type: EndpointComputeType) -> Self { + Self { + endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase::default(), + app_insights_enabled: None, + endpoint_compute_type, + instance_type: None, + liveness_probe: None, + model: None, + model_mount_path: None, + provisioning_state: None, + readiness_probe: None, + request_settings: None, + scale_settings: None, + } } } -#[doc = "Partial Registry class for PATCH"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistry {} -impl PartialRegistry { - pub fn new() -> Self { - Self::default() - } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "endpointComputeType")] +pub enum OnlineDeploymentUnion { + Kubernetes(KubernetesOnlineDeployment), + Managed(ManagedOnlineDeployment), } -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistryPartialTrackedResource { +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OnlineDeploymentTrackedResource { + #[serde(flatten)] + pub tracked_resource: TrackedResource, #[doc = "Managed service identity (system assigned and/or user assigned identities)"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, + pub identity: Option, #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub kind: Option, - #[doc = "Partial Registry class for PATCH"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Common SKU definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialRegistryPartialTrackedResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common SKU definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialSku { - #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, - #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "The name of the SKU. Ex - P3. It is typically a letter+number code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] + pub properties: OnlineDeploymentUnion, + #[doc = "The resource model definition representing SKU"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, -} -impl PartialSku { - pub fn new() -> Self { - Self::default() - } + pub sku: Option, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialUserAssignedIdentity {} -impl PartialUserAssignedIdentity { - pub fn new() -> Self { - Self::default() +impl OnlineDeploymentTrackedResource { + pub fn new(tracked_resource: TrackedResource, properties: OnlineDeploymentUnion) -> Self { + Self { + tracked_resource, + identity: None, + kind: None, + properties, + sku: None, + } } } +#[doc = "A paginated list of OnlineDeployment entities."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Password { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, +pub struct OnlineDeploymentTrackedResourceArmPaginatedResult { + #[doc = "The link to the next page of OnlineDeployment objects. If null, there are no additional pages."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "An array of objects of type OnlineDeployment."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, } -impl Password { - pub fn new() -> Self { - Self::default() +impl azure_core::Continuable for OnlineDeploymentTrackedResourceArmPaginatedResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) } } -#[doc = "Settings for a personal compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PersonalComputeInstanceSettings { - #[doc = "A user that can be assigned to a compute instance."] - #[serde(rename = "assignedUser", default, skip_serializing_if = "Option::is_none")] - pub assigned_user: Option, -} -impl PersonalComputeInstanceSettings { +impl OnlineDeploymentTrackedResourceArmPaginatedResult { pub fn new() -> Self { Self::default() } } -#[doc = "Pipeline Job definition: defines generic to MFE attributes."] +#[doc = "Online endpoint configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PipelineJob { +pub struct OnlineEndpoint { #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Inputs for the pipeline job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jobs construct the Pipeline Job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jobs: Option, - #[doc = "Outputs for the pipeline job"] + pub endpoint_properties_base: EndpointPropertiesBase, + #[doc = "ARM resource ID of the compute if it exists.\r\noptional"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Pipeline settings, for things like ContinueRunOnStepFailure etc."] + pub compute: Option, + #[doc = "State of endpoint provisioning."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option, - #[doc = "ARM resource ID of source job."] - #[serde(rename = "sourceJobId", default, skip_serializing_if = "Option::is_none")] - pub source_job_id: Option, + pub traffic: Option, } -impl PipelineJob { - pub fn new(job_base: JobBase) -> Self { +impl OnlineEndpoint { + pub fn new(endpoint_properties_base: EndpointPropertiesBase) -> Self { Self { - job_base, - inputs: None, - jobs: None, - outputs: None, - settings: None, - source_job_id: None, + endpoint_properties_base, + compute: None, + provisioning_state: None, + traffic: None, } } } -#[doc = "The Private Endpoint resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpoint { - #[doc = "The ARM identifier for Private Endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The ARM identifier for Subnet resource that private endpoint links to"] - #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] - pub subnet_arm_id: Option, -} -impl PrivateEndpoint { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The Private Endpoint Connection resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointConnection { +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OnlineEndpointTrackedResource { #[serde(flatten)] - pub resource: Resource, - #[doc = "Properties of the PrivateEndpointConnectProperties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub tracked_resource: TrackedResource, #[doc = "Managed service identity (system assigned and/or user assigned identities)"] #[serde(default, skip_serializing_if = "Option::is_none")] pub identity: Option, - #[doc = "Specifies the location of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Contains resource tags defined as key/value pairs."] + #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, + pub kind: Option, + #[doc = "Online endpoint configuration"] + pub properties: OnlineEndpoint, #[doc = "The resource model definition representing SKU"] #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, } -impl PrivateEndpointConnection { - pub fn new() -> Self { - Self::default() +impl OnlineEndpointTrackedResource { + pub fn new(tracked_resource: TrackedResource, properties: OnlineEndpoint) -> Self { + Self { + tracked_resource, + identity: None, + kind: None, + properties, + sku: None, + } } } -#[doc = "List of private endpoint connection associated with the specified workspace"] +#[doc = "A paginated list of OnlineEndpoint entities."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointConnectionListResult { - #[doc = "Array of private endpoint connections"] +pub struct OnlineEndpointTrackedResourceArmPaginatedResult { + #[doc = "The link to the next page of OnlineEndpoint objects. If null, there are no additional pages."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "An array of objects of type OnlineEndpoint."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } -impl azure_core::Continuable for PrivateEndpointConnectionListResult { +impl azure_core::Continuable for OnlineEndpointTrackedResourceArmPaginatedResult { type Continuation = String; fn continuation(&self) -> Option { - None + self.next_link.clone().filter(|value| !value.is_empty()) } } -impl PrivateEndpointConnectionListResult { +impl OnlineEndpointTrackedResourceArmPaginatedResult { pub fn new() -> Self { Self::default() } } -#[doc = "Properties of the PrivateEndpointConnectProperties."] +#[doc = "Online deployment scoring requests configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OnlineRequestSettings { + #[doc = "The number of maximum concurrent requests per node allowed per deployment. Defaults to 1."] + #[serde(rename = "maxConcurrentRequestsPerInstance", default, skip_serializing_if = "Option::is_none")] + pub max_concurrent_requests_per_instance: Option, + #[doc = "The maximum amount of time a request will stay in the queue in ISO 8601 format.\r\nDefaults to 500ms."] + #[serde(rename = "maxQueueWait", default, skip_serializing_if = "Option::is_none")] + pub max_queue_wait: Option, + #[doc = "The scoring timeout in ISO 8601 format.\r\nDefaults to 5000ms."] + #[serde(rename = "requestTimeout", default, skip_serializing_if = "Option::is_none")] + pub request_timeout: Option, +} +impl OnlineRequestSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Online deployment scaling configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PrivateEndpointConnectionProperties { - #[doc = "The Private Endpoint resource."] - #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] - pub private_endpoint: Option, - #[doc = "A collection of information about the state of the connection between service consumer and provider."] - #[serde(rename = "privateLinkServiceConnectionState")] - pub private_link_service_connection_state: PrivateLinkServiceConnectionState, - #[doc = "The current provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, +pub struct OnlineScaleSettings { + #[serde(rename = "scaleType")] + pub scale_type: ScaleType, +} +impl OnlineScaleSettings { + pub fn new(scale_type: ScaleType) -> Self { + Self { scale_type } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "scaleType")] +pub enum OnlineScaleSettingsUnion { + Default(DefaultScaleSettings), + TargetUtilization(TargetUtilizationScaleSettings), +} +#[doc = "The type of operating system."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "OperatingSystemType")] +pub enum OperatingSystemType { + Linux, + Windows, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for OperatingSystemType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for OperatingSystemType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } } -impl PrivateEndpointConnectionProperties { - pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { - Self { - private_endpoint: None, - private_link_service_connection_state, - provisioning_state: None, +impl Serialize for OperatingSystemType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Linux => serializer.serialize_unit_variant("OperatingSystemType", 0u32, "Linux"), + Self::Windows => serializer.serialize_unit_variant("OperatingSystemType", 1u32, "Windows"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "The current provisioning state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PrivateEndpointConnectionProvisioningState")] -pub enum PrivateEndpointConnectionProvisioningState { - Succeeded, - Creating, - Deleting, - Failed, +#[serde(remote = "OrderString")] +pub enum OrderString { + CreatedAtDesc, + CreatedAtAsc, + UpdatedAtDesc, + UpdatedAtAsc, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for PrivateEndpointConnectionProvisioningState { +impl FromStr for OrderString { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { +impl<'de> Deserialize<'de> for OrderString { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -11848,39 +6591,36 @@ impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { Ok(deserialized) } } -impl Serialize for PrivateEndpointConnectionProvisioningState { +impl Serialize for OrderString { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), - Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"), - Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"), + Self::CreatedAtDesc => serializer.serialize_unit_variant("OrderString", 0u32, "CreatedAtDesc"), + Self::CreatedAtAsc => serializer.serialize_unit_variant("OrderString", 1u32, "CreatedAtAsc"), + Self::UpdatedAtDesc => serializer.serialize_unit_variant("OrderString", 2u32, "UpdatedAtDesc"), + Self::UpdatedAtAsc => serializer.serialize_unit_variant("OrderString", 3u32, "UpdatedAtAsc"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "The private endpoint connection status."] +#[doc = "Output data delivery mode enums."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PrivateEndpointServiceConnectionStatus")] -pub enum PrivateEndpointServiceConnectionStatus { - Pending, - Approved, - Rejected, - Disconnected, - Timeout, +#[serde(remote = "OutputDeliveryMode")] +pub enum OutputDeliveryMode { + ReadWriteMount, + Upload, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for PrivateEndpointServiceConnectionStatus { +impl FromStr for OutputDeliveryMode { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { +impl<'de> Deserialize<'de> for OutputDeliveryMode { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -11890,381 +6630,348 @@ impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { Ok(deserialized) } } -impl Serialize for PrivateEndpointServiceConnectionStatus { +impl Serialize for OutputDeliveryMode { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Pending"), - Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Approved"), - Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"), - Self::Disconnected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 3u32, "Disconnected"), - Self::Timeout => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 4u32, "Timeout"), + Self::ReadWriteMount => serializer.serialize_unit_variant("OutputDeliveryMode", 0u32, "ReadWriteMount"), + Self::Upload => serializer.serialize_unit_variant("OutputDeliveryMode", 1u32, "Upload"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "A private link resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResource { +#[doc = "Reference to an asset via its path in a job output."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OutputPathAssetReference { #[serde(flatten)] - pub resource: Resource, - #[doc = "Properties of a private link resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Specifies the location of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Contains resource tags defined as key/value pairs."] + pub asset_reference_base: AssetReferenceBase, + #[doc = "ARM resource ID of the job."] + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option, + #[doc = "The path of the file/directory in the job output."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The resource model definition representing SKU"] + pub path: Option, +} +impl OutputPathAssetReference { + pub fn new(asset_reference_base: AssetReferenceBase) -> Self { + Self { + asset_reference_base, + job_id: None, + path: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatAuthTypeWorkspaceConnectionProperties { + #[serde(flatten)] + pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, + pub credentials: Option, } -impl PrivateLinkResource { - pub fn new() -> Self { - Self::default() +impl PatAuthTypeWorkspaceConnectionProperties { + pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { + Self { + workspace_connection_properties_v2, + credentials: None, + } } } -#[doc = "A list of private link resources"] +#[doc = "Paginated list of Machine Learning compute objects wrapped in ARM resource envelope."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResourceListResult { - #[doc = "Array of private link resources"] +pub struct PaginatedComputeResourcesList { + #[doc = "An array of Machine Learning compute objects wrapped in ARM resource envelope."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, + #[doc = "A continuation link (absolute URI) to the next page of results in the list."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, } -impl PrivateLinkResourceListResult { +impl azure_core::Continuable for PaginatedComputeResourcesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone().filter(|value| !value.is_empty()) + } +} +impl PaginatedComputeResourcesList { pub fn new() -> Self { Self::default() } } -#[doc = "Properties of a private link resource."] +#[doc = "Mutable batch inference settings per deployment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResourceProperties { - #[doc = "The private link resource group id."] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option, - #[doc = "The private link resource required member names."] - #[serde( - rename = "requiredMembers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub required_members: Vec, - #[doc = "The private link resource Private link DNS zone name."] - #[serde( - rename = "requiredZoneNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub required_zone_names: Vec, +pub struct PartialBatchDeployment { + #[doc = "Description of the endpoint deployment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, } -impl PrivateLinkResourceProperties { +impl PartialBatchDeployment { pub fn new() -> Self { Self::default() } } -#[doc = "A collection of information about the state of the connection between service consumer and provider."] +#[doc = "Strictly used in update requests."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkServiceConnectionState { - #[doc = "The private endpoint connection status."] +pub struct PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { + #[doc = "Mutable batch inference settings per deployment."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The reason for approval/rejection of the connection."] + pub properties: Option, + #[doc = "Resource tags."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "A message indicating if changes on the service provider require any updates on the consumer."] - #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] - pub actions_required: Option, + pub tags: Option, } -impl PrivateLinkServiceConnectionState { +impl PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { pub fn new() -> Self { Self::default() } } -#[doc = "Deployment container liveness/readiness probe configuration."] +#[doc = "Managed service identity (system assigned and/or user assigned identities)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProbeSettings { - #[doc = "The number of failures to allow before returning an unhealthy status."] - #[serde(rename = "failureThreshold", default, skip_serializing_if = "Option::is_none")] - pub failure_threshold: Option, - #[doc = "The delay before the first probe in ISO 8601 format."] - #[serde(rename = "initialDelay", default, skip_serializing_if = "Option::is_none")] - pub initial_delay: Option, - #[doc = "The length of time between probes in ISO 8601 format."] +pub struct PartialManagedServiceIdentity { + #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl PartialManagedServiceIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Strictly used in update requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartialMinimalTrackedResource { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl PartialMinimalTrackedResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Strictly used in update requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartialMinimalTrackedResourceWithIdentity { + #[serde(flatten)] + pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl PartialMinimalTrackedResourceWithIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Strictly used in update requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartialMinimalTrackedResourceWithSku { + #[serde(flatten)] + pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, + #[doc = "Common SKU definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl PartialMinimalTrackedResourceWithSku { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common SKU definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartialSku { + #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capacity: Option, + #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub period: Option, - #[doc = "The number of successful probes before returning a healthy status."] - #[serde(rename = "successThreshold", default, skip_serializing_if = "Option::is_none")] - pub success_threshold: Option, - #[doc = "The probe timeout in ISO 8601 format."] + pub family: Option, + #[doc = "The name of the SKU. Ex - P3. It is typically a letter+number code."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, + pub name: Option, + #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option, + #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, } -impl ProbeSettings { +impl PartialSku { pub fn new() -> Self { Self::default() } } -#[doc = "Progress metrics definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProgressMetrics { - #[doc = "The completed datapoint count."] - #[serde(rename = "completedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub completed_datapoint_count: Option, - #[doc = "The time of last successful incremental data refresh in UTC."] - #[serde(rename = "incrementalDataLastRefreshDateTime", default, with = "azure_core::date::rfc3339::option")] - pub incremental_data_last_refresh_date_time: Option, - #[doc = "The skipped datapoint count."] - #[serde(rename = "skippedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub skipped_datapoint_count: Option, - #[doc = "The total datapoint count."] - #[serde(rename = "totalDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub total_datapoint_count: Option, -} -impl ProgressMetrics { +pub struct PartialUserAssignedIdentity {} +impl PartialUserAssignedIdentity { pub fn new() -> Self { Self::default() } } -#[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PublicNetworkAccessType")] -pub enum PublicNetworkAccessType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Password { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, } -impl FromStr for PublicNetworkAccessType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) +impl Password { + pub fn new() -> Self { + Self::default() } } -impl<'de> Deserialize<'de> for PublicNetworkAccessType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } +#[doc = "Settings for a personal compute instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PersonalComputeInstanceSettings { + #[doc = "A user that can be assigned to a compute instance."] + #[serde(rename = "assignedUser", default, skip_serializing_if = "Option::is_none")] + pub assigned_user: Option, } -impl Serialize for PublicNetworkAccessType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccessType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccessType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } +impl PersonalComputeInstanceSettings { + pub fn new() -> Self { + Self::default() } } -#[doc = "PyTorch distribution configuration."] +#[doc = "Pipeline Job definition: defines generic to MFE attributes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PyTorch { +pub struct PipelineJob { #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of processes per node."] - #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] - pub process_count_per_instance: Option, + pub job_base: JobBase, + #[doc = "Inputs for the pipeline job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option, + #[doc = "Jobs construct the Pipeline Job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub jobs: Option, + #[doc = "Outputs for the pipeline job"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outputs: Option, + #[doc = "Pipeline settings, for things like ContinueRunOnStepFailure etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option, } -impl PyTorch { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { +impl PipelineJob { + pub fn new(job_base: JobBase) -> Self { Self { - distribution_configuration, - process_count_per_instance: None, + job_base, + inputs: None, + jobs: None, + outputs: None, + settings: None, } } } +#[doc = "The Private Endpoint resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueueSettings { - #[doc = "Enum to determine the job tier."] - #[serde(rename = "jobTier", default, skip_serializing_if = "Option::is_none")] - pub job_tier: Option, - #[doc = "Controls the priority of the job on a compute."] +pub struct PrivateEndpoint { + #[doc = "The ARM identifier for Private Endpoint"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option, + pub id: Option, + #[doc = "The ARM identifier for Subnet resource that private endpoint links to"] + #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] + pub subnet_arm_id: Option, } -impl QueueSettings { +impl PrivateEndpoint { pub fn new() -> Self { Self::default() } } -#[doc = "The properties for Quota update or retrieval."] +#[doc = "The Private Endpoint Connection resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QuotaBaseProperties { - #[doc = "Specifies the resource ID."] +pub struct PrivateEndpointConnection { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the PrivateEndpointConnectProperties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The maximum permitted quota of the resource."] + pub properties: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "An enum describing the unit of quota measurement."] + pub identity: Option, + #[doc = "Specifies the location of the resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, + pub location: Option, + #[doc = "Contains resource tags defined as key/value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The resource model definition representing SKU"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, } -impl QuotaBaseProperties { +impl PrivateEndpointConnection { pub fn new() -> Self { Self::default() } } -pub mod quota_base_properties { - use super::*; - #[doc = "An enum describing the unit of quota measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Quota update parameters."] +#[doc = "List of private endpoint connection associated with the specified workspace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QuotaUpdateParameters { - #[doc = "The list for update quota."] +pub struct PrivateEndpointConnectionListResult { + #[doc = "Array of private endpoint connections"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, - #[doc = "Region of workspace quota to be updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, + pub value: Vec, } -impl QuotaUpdateParameters { +impl azure_core::Continuable for PrivateEndpointConnectionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl PrivateEndpointConnectionListResult { pub fn new() -> Self { Self::default() } } -#[doc = "Defines a Sampling Algorithm that generates values randomly"] +#[doc = "Properties of the PrivateEndpointConnectProperties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RandomSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, - #[doc = "An optional positive number or e in string format to be used as base for log based random sampling"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub logbase: Option, - #[doc = "The specific type of random algorithm"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rule: Option, - #[doc = "An optional integer to use as the seed for random number generation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub seed: Option, +pub struct PrivateEndpointConnectionProperties { + #[doc = "The Private Endpoint resource."] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "A collection of information about the state of the connection between service consumer and provider."] + #[serde(rename = "privateLinkServiceConnectionState")] + pub private_link_service_connection_state: PrivateLinkServiceConnectionState, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, } -impl RandomSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { +impl PrivateEndpointConnectionProperties { + pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { Self { - sampling_algorithm, - logbase: None, - rule: None, - seed: None, - } - } -} -#[doc = "The specific type of random algorithm"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RandomSamplingAlgorithmRule")] -pub enum RandomSamplingAlgorithmRule { - Random, - Sobol, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RandomSamplingAlgorithmRule { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RandomSamplingAlgorithmRule { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RandomSamplingAlgorithmRule { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Random => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 0u32, "Random"), - Self::Sobol => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 1u32, "Sobol"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + private_endpoint: None, + private_link_service_connection_state, + provisioning_state: None, } } } -#[doc = "Enum to describe the frequency of a recurrence schedule"] +#[doc = "The current provisioning state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RecurrenceFrequency")] -pub enum RecurrenceFrequency { - Minute, - Hour, - Day, - Week, - Month, +#[serde(remote = "PrivateEndpointConnectionProvisioningState")] +pub enum PrivateEndpointConnectionProvisioningState { + Succeeded, + Creating, + Deleting, + Failed, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for RecurrenceFrequency { +impl FromStr for PrivateEndpointConnectionProvisioningState { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for RecurrenceFrequency { +impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -12274,92 +6981,39 @@ impl<'de> Deserialize<'de> for RecurrenceFrequency { Ok(deserialized) } } -impl Serialize for RecurrenceFrequency { +impl Serialize for PrivateEndpointConnectionProvisioningState { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Minute => serializer.serialize_unit_variant("RecurrenceFrequency", 0u32, "Minute"), - Self::Hour => serializer.serialize_unit_variant("RecurrenceFrequency", 1u32, "Hour"), - Self::Day => serializer.serialize_unit_variant("RecurrenceFrequency", 2u32, "Day"), - Self::Week => serializer.serialize_unit_variant("RecurrenceFrequency", 3u32, "Week"), - Self::Month => serializer.serialize_unit_variant("RecurrenceFrequency", 4u32, "Month"), + Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), + Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"), + Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } +#[doc = "The private endpoint connection status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RecurrenceSchedule { - #[doc = "[Required] List of hours for the schedule."] - pub hours: Vec, - #[doc = "[Required] List of minutes for the schedule."] - pub minutes: Vec, - #[doc = "List of month days for the schedule"] - #[serde( - rename = "monthDays", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub month_days: Vec, - #[doc = "List of days for the schedule."] - #[serde( - rename = "weekDays", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub week_days: Vec, -} -impl RecurrenceSchedule { - pub fn new(hours: Vec, minutes: Vec) -> Self { - Self { - hours, - minutes, - month_days: Vec::new(), - week_days: Vec::new(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RecurrenceTrigger { - #[serde(flatten)] - pub trigger_base: TriggerBase, - #[doc = "Enum to describe the frequency of a recurrence schedule"] - pub frequency: RecurrenceFrequency, - #[doc = "[Required] Specifies schedule interval in conjunction with frequency"] - pub interval: i32, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl RecurrenceTrigger { - pub fn new(trigger_base: TriggerBase, frequency: RecurrenceFrequency, interval: i32) -> Self { - Self { - trigger_base, - frequency, - interval, - schedule: None, - } - } -} -#[doc = "Enum to determine which reference method to use for an asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ReferenceType")] -pub enum ReferenceType { - Id, - DataPath, - OutputPath, +#[serde(remote = "PrivateEndpointServiceConnectionStatus")] +pub enum PrivateEndpointServiceConnectionStatus { + Pending, + Approved, + Rejected, + Disconnected, + Timeout, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for ReferenceType { +impl FromStr for PrivateEndpointServiceConnectionStatus { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for ReferenceType { +impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -12369,217 +7023,265 @@ impl<'de> Deserialize<'de> for ReferenceType { Ok(deserialized) } } -impl Serialize for ReferenceType { +impl Serialize for PrivateEndpointServiceConnectionStatus { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Id => serializer.serialize_unit_variant("ReferenceType", 0u32, "Id"), - Self::DataPath => serializer.serialize_unit_variant("ReferenceType", 1u32, "DataPath"), - Self::OutputPath => serializer.serialize_unit_variant("ReferenceType", 2u32, "OutputPath"), + Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Pending"), + Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Approved"), + Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"), + Self::Disconnected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 3u32, "Disconnected"), + Self::Timeout => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 4u32, "Timeout"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegenerateEndpointKeysRequest { - #[serde(rename = "keyType")] - pub key_type: KeyType, - #[doc = "The value the key is set to."] - #[serde(rename = "keyValue", default, skip_serializing_if = "Option::is_none")] - pub key_value: Option, -} -impl RegenerateEndpointKeysRequest { - pub fn new(key_type: KeyType) -> Self { - Self { key_type, key_value: None } - } -} -#[doc = "Details of the Registry"] +#[doc = "A private link resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Registry { +pub struct PrivateLinkResource { #[serde(flatten)] - pub resource_base: ResourceBase, - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] - pub discovery_url: Option, - #[serde(rename = "intellectualPropertyPublisher", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property_publisher: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "managedResourceGroup", default, skip_serializing_if = "Option::is_none")] - pub managed_resource_group: Option, - #[serde(rename = "mlFlowRegistryUri", default, skip_serializing_if = "Option::is_none")] - pub ml_flow_registry_uri: Option, - #[serde(rename = "privateLinkCount", default, skip_serializing_if = "Option::is_none")] - pub private_link_count: Option, - #[doc = "Details of each region the registry is in"] - #[serde( - rename = "regionDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub region_details: Vec, - #[doc = "Tags to be applied to the managed resource group associated with this registry."] - #[serde(rename = "managedResourceGroupTags", default, skip_serializing_if = "Option::is_none")] - pub managed_resource_group_tags: Option, + pub resource: Resource, + #[doc = "Properties of a private link resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Specifies the location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Contains resource tags defined as key/value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The resource model definition representing SKU"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, } -impl Registry { +impl PrivateLinkResource { pub fn new() -> Self { Self::default() } } +#[doc = "A list of private link resources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryListCredentialsResult { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, +pub struct PrivateLinkResourceListResult { + #[doc = "Array of private link resources"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub passwords: Vec, + pub value: Vec, } -impl RegistryListCredentialsResult { +impl PrivateLinkResourceListResult { pub fn new() -> Self { Self::default() } } -#[doc = "Details for each region the registry is in"] +#[doc = "Properties of a private link resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryRegionArmDetails { - #[doc = "List of ACR accounts"] +pub struct PrivateLinkResourceProperties { + #[doc = "The private link resource group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "The private link resource required member names."] #[serde( - rename = "acrDetails", + rename = "requiredMembers", default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub acr_details: Vec, - #[doc = "The location where the registry exists"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "List of storage accounts"] + pub required_members: Vec, + #[doc = "The private link resource Private link DNS zone name."] #[serde( - rename = "storageAccountDetails", + rename = "requiredZoneNames", default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub storage_account_details: Vec, + pub required_zone_names: Vec, +} +impl PrivateLinkResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A collection of information about the state of the connection between service consumer and provider."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkServiceConnectionState { + #[doc = "The private endpoint connection status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The reason for approval/rejection of the connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "A message indicating if changes on the service provider require any updates on the consumer."] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, +} +impl PrivateLinkServiceConnectionState { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Deployment container liveness/readiness probe configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProbeSettings { + #[doc = "The number of failures to allow before returning an unhealthy status."] + #[serde(rename = "failureThreshold", default, skip_serializing_if = "Option::is_none")] + pub failure_threshold: Option, + #[doc = "The delay before the first probe in ISO 8601 format."] + #[serde(rename = "initialDelay", default, skip_serializing_if = "Option::is_none")] + pub initial_delay: Option, + #[doc = "The length of time between probes in ISO 8601 format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub period: Option, + #[doc = "The number of successful probes before returning a healthy status."] + #[serde(rename = "successThreshold", default, skip_serializing_if = "Option::is_none")] + pub success_threshold: Option, + #[doc = "The probe timeout in ISO 8601 format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, } -impl RegistryRegionArmDetails { +impl ProbeSettings { pub fn new() -> Self { Self::default() } } +#[doc = "PyTorch distribution configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegistryTrackedResource { +pub struct PyTorch { #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + pub distribution_configuration: DistributionConfiguration, + #[doc = "Number of processes per node."] + #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] + pub process_count_per_instance: Option, +} +impl PyTorch { + pub fn new(distribution_configuration: DistributionConfiguration) -> Self { + Self { + distribution_configuration, + process_count_per_instance: None, + } + } +} +#[doc = "The properties for Quota update or retrieval."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QuotaBaseProperties { + #[doc = "Specifies the resource ID."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] + pub id: Option, + #[doc = "Specifies the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The maximum permitted quota of the resource."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Details of the Registry"] - pub properties: Registry, - #[doc = "The resource model definition representing SKU"] + pub limit: Option, + #[doc = "An enum describing the unit of quota measurement."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, + pub unit: Option, } -impl RegistryTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: Registry) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, +impl QuotaBaseProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod quota_base_properties { + use super::*; + #[doc = "An enum describing the unit of quota measurement."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Unit")] + pub enum Unit { + Count, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Unit { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Unit { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Unit { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } } -#[doc = "A paginated list of Registry entities."] +#[doc = "Quota update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of Registry objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Registry."] +pub struct QuotaUpdateParameters { + #[doc = "The list for update quota."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, -} -impl azure_core::Continuable for RegistryTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } + pub value: Vec, + #[doc = "Region of workspace quota to be updated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, } -impl RegistryTrackedResourceArmPaginatedResult { +impl QuotaUpdateParameters { pub fn new() -> Self { Self::default() } } -#[doc = "Regression task in AutoML Table vertical."] +#[doc = "Defines a Sampling Algorithm that generates values randomly"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Regression { - #[serde(flatten)] - pub table_vertical: TableVertical, +pub struct RandomSamplingAlgorithm { #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for Regression task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Regression Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Regression { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { + pub sampling_algorithm: SamplingAlgorithm, + #[doc = "The specific type of random algorithm"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rule: Option, + #[doc = "An optional integer to use as the seed for random number generation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub seed: Option, +} +impl RandomSamplingAlgorithm { + pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - primary_metric: None, - training_settings: None, + sampling_algorithm, + rule: None, + seed: None, } } } -#[doc = "Enum for all Regression models supported by AutoML."] +#[doc = "The specific type of random algorithm"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionModels")] -pub enum RegressionModels { - ElasticNet, - GradientBoosting, - DecisionTree, - #[serde(rename = "KNN")] - Knn, - LassoLars, - #[serde(rename = "SGD")] - Sgd, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - #[serde(rename = "XGBoostRegressor")] - XgBoostRegressor, +#[serde(remote = "RandomSamplingAlgorithmRule")] +pub enum RandomSamplingAlgorithmRule { + Random, + Sobol, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for RegressionModels { +impl FromStr for RandomSamplingAlgorithmRule { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for RegressionModels { +impl<'de> Deserialize<'de> for RandomSamplingAlgorithmRule { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -12589,44 +7291,35 @@ impl<'de> Deserialize<'de> for RegressionModels { Ok(deserialized) } } -impl Serialize for RegressionModels { +impl Serialize for RandomSamplingAlgorithmRule { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::ElasticNet => serializer.serialize_unit_variant("RegressionModels", 0u32, "ElasticNet"), - Self::GradientBoosting => serializer.serialize_unit_variant("RegressionModels", 1u32, "GradientBoosting"), - Self::DecisionTree => serializer.serialize_unit_variant("RegressionModels", 2u32, "DecisionTree"), - Self::Knn => serializer.serialize_unit_variant("RegressionModels", 3u32, "KNN"), - Self::LassoLars => serializer.serialize_unit_variant("RegressionModels", 4u32, "LassoLars"), - Self::Sgd => serializer.serialize_unit_variant("RegressionModels", 5u32, "SGD"), - Self::RandomForest => serializer.serialize_unit_variant("RegressionModels", 6u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("RegressionModels", 7u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("RegressionModels", 8u32, "LightGBM"), - Self::XgBoostRegressor => serializer.serialize_unit_variant("RegressionModels", 9u32, "XGBoostRegressor"), + Self::Random => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 0u32, "Random"), + Self::Sobol => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 1u32, "Sobol"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Primary metrics for Regression task."] +#[doc = "Enum to determine which reference method to use for an asset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionPrimaryMetrics")] -pub enum RegressionPrimaryMetrics { - SpearmanCorrelation, - NormalizedRootMeanSquaredError, - R2Score, - NormalizedMeanAbsoluteError, +#[serde(remote = "ReferenceType")] +pub enum ReferenceType { + Id, + DataPath, + OutputPath, #[serde(skip_deserializing)] UnknownValue(String), } -impl FromStr for RegressionPrimaryMetrics { +impl FromStr for ReferenceType { type Err = value::Error; fn from_str(s: &str) -> std::result::Result { Self::deserialize(s.into_deserializer()) } } -impl<'de> Deserialize<'de> for RegressionPrimaryMetrics { +impl<'de> Deserialize<'de> for ReferenceType { fn deserialize(deserializer: D) -> std::result::Result where D: Deserializer<'de>, @@ -12636,47 +7329,46 @@ impl<'de> Deserialize<'de> for RegressionPrimaryMetrics { Ok(deserialized) } } -impl Serialize for RegressionPrimaryMetrics { +impl Serialize for ReferenceType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::SpearmanCorrelation => serializer.serialize_unit_variant("RegressionPrimaryMetrics", 0u32, "SpearmanCorrelation"), - Self::NormalizedRootMeanSquaredError => { - serializer.serialize_unit_variant("RegressionPrimaryMetrics", 1u32, "NormalizedRootMeanSquaredError") - } - Self::R2Score => serializer.serialize_unit_variant("RegressionPrimaryMetrics", 2u32, "R2Score"), - Self::NormalizedMeanAbsoluteError => { - serializer.serialize_unit_variant("RegressionPrimaryMetrics", 3u32, "NormalizedMeanAbsoluteError") - } + Self::Id => serializer.serialize_unit_variant("ReferenceType", 0u32, "Id"), + Self::DataPath => serializer.serialize_unit_variant("ReferenceType", 1u32, "DataPath"), + Self::OutputPath => serializer.serialize_unit_variant("ReferenceType", 2u32, "OutputPath"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -#[doc = "Regression Training related configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegenerateEndpointKeysRequest { + #[serde(rename = "keyType")] + pub key_type: KeyType, + #[doc = "The value the key is set to."] + #[serde(rename = "keyValue", default, skip_serializing_if = "Option::is_none")] + pub key_value: Option, +} +impl RegenerateEndpointKeysRequest { + pub fn new(key_type: KeyType) -> Self { + Self { key_type, key_value: None } + } +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegressionTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for regression task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for regression task."] +pub struct RegistryListCredentialsResult { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, #[serde( - rename = "blockedTrainingAlgorithms", default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub blocked_training_algorithms: Vec, + pub passwords: Vec, } -impl RegressionTrainingSettings { +impl RegistryListCredentialsResult { pub fn new() -> Self { Self::default() } @@ -12727,13 +7419,6 @@ pub struct ResourceConfiguration { #[doc = "Optional type of VM used as supported by the compute target."] #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] pub instance_type: Option, - #[doc = "Locations where the job can run."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub locations: Vec, #[doc = "Additional properties bag."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -13020,95 +7705,12 @@ impl Serialize for ScaleType { } } } -#[doc = "Base definition of a schedule"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Schedule { - #[serde(flatten)] - pub resource_base: ResourceBase, - pub action: ScheduleActionBaseUnion, - #[doc = "Display name of schedule."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Is the schedule enabled?"] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option, - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - pub trigger: TriggerBaseUnion, -} -impl Schedule { - pub fn new(action: ScheduleActionBaseUnion, trigger: TriggerBaseUnion) -> Self { - Self { - resource_base: ResourceBase::default(), - action, - display_name: None, - is_enabled: None, - provisioning_state: None, - trigger, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduleActionBase { - #[serde(rename = "actionType")] - pub action_type: ScheduleActionType, -} -impl ScheduleActionBase { - pub fn new(action_type: ScheduleActionType) -> Self { - Self { action_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "actionType")] -pub enum ScheduleActionBaseUnion { - InvokeBatchEndpoint(EndpointScheduleAction), - CreateJob(JobScheduleAction), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleActionType")] -pub enum ScheduleActionType { - CreateJob, - InvokeBatchEndpoint, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleActionType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleActionType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleActionType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreateJob => serializer.serialize_unit_variant("ScheduleActionType", 0u32, "CreateJob"), - Self::InvokeBatchEndpoint => serializer.serialize_unit_variant("ScheduleActionType", 1u32, "InvokeBatchEndpoint"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleBase { - #[doc = "A system assigned id for the schedule."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, - #[doc = "The current deployment state of schedule."] #[serde(rename = "provisioningStatus", default, skip_serializing_if = "Option::is_none")] pub provisioning_status: Option, - #[doc = "Is the schedule enabled or disabled?"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, } @@ -13118,45 +7720,6 @@ impl ScheduleBase { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleListViewType")] -pub enum ScheduleListViewType { - EnabledOnly, - DisabledOnly, - All, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleListViewType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleListViewType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleListViewType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::EnabledOnly => serializer.serialize_unit_variant("ScheduleListViewType", 0u32, "EnabledOnly"), - Self::DisabledOnly => serializer.serialize_unit_variant("ScheduleListViewType", 1u32, "DisabledOnly"), - Self::All => serializer.serialize_unit_variant("ScheduleListViewType", 2u32, "All"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The current deployment state of schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScheduleProvisioningState")] pub enum ScheduleProvisioningState { Completed, @@ -13195,92 +7758,6 @@ impl Serialize for ScheduleProvisioningState { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleProvisioningStatus")] -pub enum ScheduleProvisioningStatus { - Creating, - Updating, - Deleting, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleProvisioningStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleProvisioningStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleProvisioningStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 0u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 1u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 2u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 3u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 4u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 5u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduleResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Base definition of a schedule"] - pub properties: Schedule, -} -impl ScheduleResource { - pub fn new(properties: Schedule) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of Schedule entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScheduleResourceArmPaginatedResult { - #[doc = "The link to the next page of Schedule objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Schedule."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ScheduleResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ScheduleResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Is the schedule enabled or disabled?"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ScheduleStatus")] pub enum ScheduleStatus { Enabled, @@ -13343,67 +7820,13 @@ pub struct ScriptsToExecute { #[doc = "Script reference"] #[serde(rename = "startupScript", default, skip_serializing_if = "Option::is_none")] pub startup_script: Option, - #[doc = "Script reference"] - #[serde(rename = "creationScript", default, skip_serializing_if = "Option::is_none")] - pub creation_script: Option, -} -impl ScriptsToExecute { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecasting seasonality."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Seasonality { - #[doc = "Forecasting seasonality mode."] - pub mode: SeasonalityMode, -} -impl Seasonality { - pub fn new(mode: SeasonalityMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum SeasonalityUnion { - Auto(AutoSeasonality), - Custom(CustomSeasonality), -} -#[doc = "Forecasting seasonality mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SeasonalityMode")] -pub enum SeasonalityMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SeasonalityMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SeasonalityMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } + #[doc = "Script reference"] + #[serde(rename = "creationScript", default, skip_serializing_if = "Option::is_none")] + pub creation_script: Option, } -impl Serialize for SeasonalityMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("SeasonalityMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("SeasonalityMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } +impl ScriptsToExecute { + pub fn new() -> Self { + Self::default() } } #[doc = "Enum to determine the datastore secrets type."] @@ -13414,8 +7837,6 @@ pub enum SecretsType { Certificate, Sas, ServicePrincipal, - KerberosPassword, - KerberosKeytab, #[serde(skip_deserializing)] UnknownValue(String), } @@ -13445,8 +7866,6 @@ impl Serialize for SecretsType { Self::Certificate => serializer.serialize_unit_variant("SecretsType", 1u32, "Certificate"), Self::Sas => serializer.serialize_unit_variant("SecretsType", 2u32, "Sas"), Self::ServicePrincipal => serializer.serialize_unit_variant("SecretsType", 3u32, "ServicePrincipal"), - Self::KerberosPassword => serializer.serialize_unit_variant("SecretsType", 4u32, "KerberosPassword"), - Self::KerberosKeytab => serializer.serialize_unit_variant("SecretsType", 5u32, "KerberosKeytab"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -13503,21 +7922,6 @@ impl ServiceManagedResourcesSettings { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ServicePrincipalAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} #[doc = "Service Principal datastore credentials configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServicePrincipalDatastoreCredentials { @@ -13619,47 +8023,6 @@ impl SharedPrivateLinkResourceProperty { Self::default() } } -#[doc = "The parameter defining how if AutoML should handle short time series."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ShortSeriesHandlingConfiguration")] -pub enum ShortSeriesHandlingConfiguration { - None, - Auto, - Pad, - Drop, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ShortSeriesHandlingConfiguration { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ShortSeriesHandlingConfiguration { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ShortSeriesHandlingConfiguration { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 0u32, "None"), - Self::Auto => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 1u32, "Auto"), - Self::Pad => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 2u32, "Pad"), - Self::Drop => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 3u32, "Drop"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "The resource model definition representing SKU"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Sku { @@ -13814,180 +8177,6 @@ pub enum SkuTier { Standard, Premium, } -#[doc = "Spark job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Archive files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub archives: Vec, - #[doc = "Arguments for the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub args: Option, - #[doc = "[Required] ARM resource ID of the code asset."] - #[serde(rename = "codeId")] - pub code_id: String, - #[doc = "Spark configured properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub conf: Option, - #[doc = "Spark job entry point definition."] - pub entry: SparkJobEntryUnion, - #[doc = "The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub files: Vec, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jar files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub jars: Vec, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Python files used in the job."] - #[serde( - rename = "pyFiles", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub py_files: Vec, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl SparkJob { - pub fn new(job_base: JobBase, code_id: String, entry: SparkJobEntryUnion) -> Self { - Self { - job_base, - archives: Vec::new(), - args: None, - code_id, - conf: None, - entry, - environment_id: None, - files: Vec::new(), - inputs: None, - jars: Vec::new(), - outputs: None, - py_files: Vec::new(), - queue_settings: None, - resources: None, - } - } -} -#[doc = "Spark job entry point definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobEntry { - #[serde(rename = "sparkJobEntryType")] - pub spark_job_entry_type: SparkJobEntryType, -} -impl SparkJobEntry { - pub fn new(spark_job_entry_type: SparkJobEntryType) -> Self { - Self { spark_job_entry_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "sparkJobEntryType")] -pub enum SparkJobEntryUnion { - SparkJobPythonEntry(SparkJobPythonEntry), - SparkJobScalaEntry(SparkJobScalaEntry), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SparkJobEntryType")] -pub enum SparkJobEntryType { - SparkJobPythonEntry, - SparkJobScalaEntry, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SparkJobEntryType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SparkJobEntryType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SparkJobEntryType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SparkJobPythonEntry => serializer.serialize_unit_variant("SparkJobEntryType", 0u32, "SparkJobPythonEntry"), - Self::SparkJobScalaEntry => serializer.serialize_unit_variant("SparkJobEntryType", 1u32, "SparkJobScalaEntry"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobPythonEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Relative python file path for job entry point."] - pub file: String, -} -impl SparkJobPythonEntry { - pub fn new(spark_job_entry: SparkJobEntry, file: String) -> Self { - Self { spark_job_entry, file } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobScalaEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Scala class name used as entry point."] - #[serde(rename = "className")] - pub class_name: String, -} -impl SparkJobScalaEntry { - pub fn new(spark_job_entry: SparkJobEntry, class_name: String) -> Self { - Self { - spark_job_entry, - class_name, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SparkResourceConfiguration { - #[doc = "Optional type of VM used as supported by the compute target."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Version of spark runtime used for the job."] - #[serde(rename = "runtimeVersion", default, skip_serializing_if = "Option::is_none")] - pub runtime_version: Option, -} -impl SparkResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} #[doc = "The ssl configuration for scoring"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SslConfiguration { @@ -14057,189 +8246,6 @@ pub mod ssl_configuration { } } } -#[doc = "Advances setting to customize StackEnsemble run."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StackEnsembleSettings { - #[doc = "Optional parameters to pass to the initializer of the meta-learner."] - #[serde(rename = "stackMetaLearnerKWargs", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_k_wargs: Option, - #[doc = "Specifies the proportion of the training set (when choosing train and validation type of training) to be reserved for training the meta-learner. Default value is 0.2."] - #[serde(rename = "stackMetaLearnerTrainPercentage", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_train_percentage: Option, - #[doc = "The meta-learner is a model trained on the output of the individual heterogeneous models.\r\nDefault meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled).\r\nThis parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression"] - #[serde(rename = "stackMetaLearnerType", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_type: Option, -} -impl StackEnsembleSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The meta-learner is a model trained on the output of the individual heterogeneous models.\r\nDefault meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled).\r\nThis parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StackMetaLearnerType")] -pub enum StackMetaLearnerType { - None, - LogisticRegression, - #[serde(rename = "LogisticRegressionCV")] - LogisticRegressionCv, - #[serde(rename = "LightGBMClassifier")] - LightGbmClassifier, - ElasticNet, - #[serde(rename = "ElasticNetCV")] - ElasticNetCv, - #[serde(rename = "LightGBMRegressor")] - LightGbmRegressor, - LinearRegression, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StackMetaLearnerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StackMetaLearnerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StackMetaLearnerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("StackMetaLearnerType", 0u32, "None"), - Self::LogisticRegression => serializer.serialize_unit_variant("StackMetaLearnerType", 1u32, "LogisticRegression"), - Self::LogisticRegressionCv => serializer.serialize_unit_variant("StackMetaLearnerType", 2u32, "LogisticRegressionCV"), - Self::LightGbmClassifier => serializer.serialize_unit_variant("StackMetaLearnerType", 3u32, "LightGBMClassifier"), - Self::ElasticNet => serializer.serialize_unit_variant("StackMetaLearnerType", 4u32, "ElasticNet"), - Self::ElasticNetCv => serializer.serialize_unit_variant("StackMetaLearnerType", 5u32, "ElasticNetCV"), - Self::LightGbmRegressor => serializer.serialize_unit_variant("StackMetaLearnerType", 6u32, "LightGBMRegressor"), - Self::LinearRegression => serializer.serialize_unit_variant("StackMetaLearnerType", 7u32, "LinearRegression"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Active message associated with project"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StatusMessage { - #[doc = "Service-defined message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Time in UTC at which the message was created."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "A human-readable representation of the message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl StatusMessage { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StatusMessageLevel")] -pub enum StatusMessageLevel { - Error, - Information, - Warning, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StatusMessageLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StatusMessageLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StatusMessageLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Error => serializer.serialize_unit_variant("StatusMessageLevel", 0u32, "Error"), - Self::Information => serializer.serialize_unit_variant("StatusMessageLevel", 1u32, "Information"), - Self::Warning => serializer.serialize_unit_variant("StatusMessageLevel", 2u32, "Warning"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stochastic optimizer for image models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StochasticOptimizer")] -pub enum StochasticOptimizer { - None, - Sgd, - Adam, - Adamw, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StochasticOptimizer { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StochasticOptimizer { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StochasticOptimizer { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("StochasticOptimizer", 0u32, "None"), - Self::Sgd => serializer.serialize_unit_variant("StochasticOptimizer", 1u32, "Sgd"), - Self::Adam => serializer.serialize_unit_variant("StochasticOptimizer", 2u32, "Adam"), - Self::Adamw => serializer.serialize_unit_variant("StochasticOptimizer", 3u32, "Adamw"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Details of storage account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StorageAccountDetails { - #[serde(rename = "systemCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_storage_account: Option, - #[serde(rename = "userCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_storage_account: Option, -} -impl StorageAccountDetails { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Sweep job definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SweepJob { @@ -14259,8 +8265,6 @@ pub struct SweepJob { #[doc = "Mapping of output data bindings used in the job."] #[serde(default, skip_serializing_if = "Option::is_none")] pub outputs: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, #[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] #[serde(rename = "samplingAlgorithm")] pub sampling_algorithm: SamplingAlgorithmUnion, @@ -14285,7 +8289,6 @@ impl SweepJob { limits: None, objective, outputs: None, - queue_settings: None, sampling_algorithm, search_space, trial, @@ -14371,37 +8374,6 @@ pub mod synapse_spark { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedAcrAccount { - #[serde(rename = "acrAccountSku", default, skip_serializing_if = "Option::is_none")] - pub acr_account_sku: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl SystemCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedStorageAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, - #[serde(rename = "storageAccountHnsEnabled", default, skip_serializing_if = "Option::is_none")] - pub storage_account_hns_enabled: Option, - #[doc = "Allowed values:\r\n\"Standard_LRS\",\r\n\"Standard_GRS\",\r\n\"Standard_RAGRS\",\r\n\"Standard_ZRS\",\r\n\"Standard_GZRS\",\r\n\"Standard_RAGZRS\",\r\n\"Premium_LRS\",\r\n\"Premium_ZRS\""] - #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] - pub storage_account_type: Option, - #[serde(rename = "allowBlobPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub allow_blob_public_access: Option, -} -impl SystemCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} #[doc = "A system service running on a compute."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SystemService { @@ -14420,432 +8392,6 @@ impl SystemService { Self::default() } } -#[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableFixedParameters { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample."] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableParameterSubspace { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample"] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TableSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl TableSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVertical { - #[doc = "Columns to use for CVSplit data."] - #[serde( - rename = "cvSplitColumnNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub cv_split_column_names: Vec, - #[doc = "Featurization Configuration."] - #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] - pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, - #[doc = "Job execution constraints."] - #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] - pub limit_settings: Option, - #[doc = "N-Cross validations value."] - #[serde(rename = "nCrossValidations", default, skip_serializing_if = "Option::is_none")] - pub n_cross_validations: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "testData", default, skip_serializing_if = "Option::is_none")] - pub test_data: Option, - #[doc = "The fraction of test dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "testDataSize", default, skip_serializing_if = "Option::is_none")] - pub test_data_size: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, - #[doc = "The fraction of training dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "validationDataSize", default, skip_serializing_if = "Option::is_none")] - pub validation_data_size: Option, - #[doc = "The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down."] - #[serde(rename = "weightColumnName", default, skip_serializing_if = "Option::is_none")] - pub weight_column_name: Option, -} -impl TableVertical { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Featurization Configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVerticalFeaturizationSettings { - #[serde(flatten)] - pub featurization_settings: FeaturizationSettings, - #[doc = "These transformers shall not be used in featurization."] - #[serde( - rename = "blockedTransformers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_transformers: Vec, - #[doc = "Dictionary of column name and its type (int, float, string, datetime etc)."] - #[serde(rename = "columnNameAndTypes", default, skip_serializing_if = "Option::is_none")] - pub column_name_and_types: Option, - #[doc = "Determines whether to use Dnn based featurizers for data featurization."] - #[serde(rename = "enableDnnFeaturization", default, skip_serializing_if = "Option::is_none")] - pub enable_dnn_featurization: Option, - #[doc = "Featurization mode - determines data featurization mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "User can specify additional transformers to be used along with the columns to which it would be applied and parameters for the transformer constructor."] - #[serde(rename = "transformerParams", default, skip_serializing_if = "Option::is_none")] - pub transformer_params: Option, -} -impl TableVerticalFeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Job execution constraints."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVerticalLimitSettings { - #[doc = "Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations."] - #[serde(rename = "enableEarlyTermination", default, skip_serializing_if = "Option::is_none")] - pub enable_early_termination: Option, - #[doc = "Exit score for the AutoML job."] - #[serde(rename = "exitScore", default, skip_serializing_if = "Option::is_none")] - pub exit_score: Option, - #[doc = "Maximum Concurrent iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Max cores per iteration."] - #[serde(rename = "maxCoresPerTrial", default, skip_serializing_if = "Option::is_none")] - pub max_cores_per_trial: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, - #[doc = "Number of iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "Number of concurrent sweeping runs that user wants to trigger."] - #[serde(rename = "sweepConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_concurrent_trials: Option, - #[doc = "Number of sweeping runs that user wants to trigger."] - #[serde(rename = "sweepTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[doc = "Iteration timeout."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl TableVerticalLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Target aggregate function."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetAggregationFunction")] -pub enum TargetAggregationFunction { - None, - Sum, - Max, - Min, - Mean, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetAggregationFunction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetAggregationFunction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetAggregationFunction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("TargetAggregationFunction", 0u32, "None"), - Self::Sum => serializer.serialize_unit_variant("TargetAggregationFunction", 1u32, "Sum"), - Self::Max => serializer.serialize_unit_variant("TargetAggregationFunction", 2u32, "Max"), - Self::Min => serializer.serialize_unit_variant("TargetAggregationFunction", 3u32, "Min"), - Self::Mean => serializer.serialize_unit_variant("TargetAggregationFunction", 4u32, "Mean"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The number of past periods to lag from the target column."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetLags { - #[doc = "Target lags selection modes."] - pub mode: TargetLagsMode, -} -impl TargetLags { - pub fn new(mode: TargetLagsMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum TargetLagsUnion { - Auto(AutoTargetLags), - Custom(CustomTargetLags), -} -#[doc = "Target lags selection modes."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetLagsMode")] -pub enum TargetLagsMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetLagsMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetLagsMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetLagsMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TargetLagsMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("TargetLagsMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Forecasting target rolling window size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetRollingWindowSize { - #[doc = "Target rolling windows size mode."] - pub mode: TargetRollingWindowSizeMode, -} -impl TargetRollingWindowSize { - pub fn new(mode: TargetRollingWindowSizeMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum TargetRollingWindowSizeUnion { - Auto(AutoTargetRollingWindowSize), - Custom(CustomTargetRollingWindowSize), -} -#[doc = "Target rolling windows size mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetRollingWindowSizeMode")] -pub enum TargetRollingWindowSizeMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetRollingWindowSizeMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetRollingWindowSizeMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetRollingWindowSizeMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TargetRollingWindowSizeMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("TargetRollingWindowSizeMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TargetUtilizationScaleSettings { #[serde(flatten)] @@ -14874,60 +8420,6 @@ impl TargetUtilizationScaleSettings { } } } -#[doc = "AutoMLJob Task type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TaskType")] -pub enum TaskType { - Classification, - Regression, - Forecasting, - ImageClassification, - ImageClassificationMultilabel, - ImageObjectDetection, - ImageInstanceSegmentation, - TextClassification, - TextClassificationMultilabel, - #[serde(rename = "TextNER")] - TextNer, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TaskType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TaskType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TaskType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TaskType", 0u32, "Classification"), - Self::Regression => serializer.serialize_unit_variant("TaskType", 1u32, "Regression"), - Self::Forecasting => serializer.serialize_unit_variant("TaskType", 2u32, "Forecasting"), - Self::ImageClassification => serializer.serialize_unit_variant("TaskType", 3u32, "ImageClassification"), - Self::ImageClassificationMultilabel => serializer.serialize_unit_variant("TaskType", 4u32, "ImageClassificationMultilabel"), - Self::ImageObjectDetection => serializer.serialize_unit_variant("TaskType", 5u32, "ImageObjectDetection"), - Self::ImageInstanceSegmentation => serializer.serialize_unit_variant("TaskType", 6u32, "ImageInstanceSegmentation"), - Self::TextClassification => serializer.serialize_unit_variant("TaskType", 7u32, "TextClassification"), - Self::TextClassificationMultilabel => serializer.serialize_unit_variant("TaskType", 8u32, "TextClassificationMultilabel"), - Self::TextNer => serializer.serialize_unit_variant("TaskType", 9u32, "TextNER"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "TensorFlow distribution configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TensorFlow { @@ -14938,125 +8430,17 @@ pub struct TensorFlow { pub parameter_server_count: Option, #[doc = "Number of workers. If not specified, will default to the instance count."] #[serde(rename = "workerCount", default, skip_serializing_if = "Option::is_none")] - pub worker_count: Option, -} -impl TensorFlow { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - parameter_server_count: None, - worker_count: None, - } - } -} -#[doc = "Annotation type of text data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TextAnnotationType")] -pub enum TextAnnotationType { - Classification, - NamedEntityRecognition, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TextAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TextAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TextAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TextAnnotationType", 0u32, "Classification"), - Self::NamedEntityRecognition => serializer.serialize_unit_variant("TextAnnotationType", 1u32, "NamedEntityRecognition"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Text Classification task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextClassification { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextClassification { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Text Classification Multilabel task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextClassificationMultilabel { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification multilabel tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextClassificationMultilabel { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Text-NER task in AutoML NLP vertical.\r\nNER - Named Entity Recognition.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextNer { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, + pub worker_count: Option, } -impl TextNer { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { +impl TensorFlow { + pub fn new(distribution_configuration: DistributionConfiguration) -> Self { Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, + distribution_configuration, + parameter_server_count: None, + worker_count: None, } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TmpfsOptions { - #[doc = "Mention the Tmpfs size"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, -} -impl TmpfsOptions { - pub fn new() -> Self { - Self::default() - } -} #[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackedResource { @@ -15077,78 +8461,6 @@ impl TrackedResource { } } } -#[doc = "Training mode dictates whether to use distributed training or not"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TrainingMode")] -pub enum TrainingMode { - Auto, - Distributed, - NonDistributed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TrainingMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TrainingMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TrainingMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TrainingMode", 0u32, "Auto"), - Self::Distributed => serializer.serialize_unit_variant("TrainingMode", 1u32, "Distributed"), - Self::NonDistributed => serializer.serialize_unit_variant("TrainingMode", 2u32, "NonDistributed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TrainingSettings { - #[doc = "Enable recommendation of DNN models."] - #[serde(rename = "enableDnnTraining", default, skip_serializing_if = "Option::is_none")] - pub enable_dnn_training: Option, - #[doc = "Flag to turn on explainability on best model."] - #[serde(rename = "enableModelExplainability", default, skip_serializing_if = "Option::is_none")] - pub enable_model_explainability: Option, - #[doc = "Flag for enabling onnx compatible models."] - #[serde(rename = "enableOnnxCompatibleModels", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_compatible_models: Option, - #[doc = "Enable stack ensemble run."] - #[serde(rename = "enableStackEnsemble", default, skip_serializing_if = "Option::is_none")] - pub enable_stack_ensemble: Option, - #[doc = "Enable voting ensemble run."] - #[serde(rename = "enableVoteEnsemble", default, skip_serializing_if = "Option::is_none")] - pub enable_vote_ensemble: Option, - #[doc = "During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded.\r\nConfigure this parameter with a higher value than 300 secs, if more time is needed."] - #[serde(rename = "ensembleModelDownloadTimeout", default, skip_serializing_if = "Option::is_none")] - pub ensemble_model_download_timeout: Option, - #[doc = "Advances setting to customize StackEnsemble run."] - #[serde(rename = "stackEnsembleSettings", default, skip_serializing_if = "Option::is_none")] - pub stack_ensemble_settings: Option, - #[doc = "Training mode dictates whether to use distributed training or not"] - #[serde(rename = "trainingMode", default, skip_serializing_if = "Option::is_none")] - pub training_mode: Option, -} -impl TrainingSettings { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Trial component definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrialComponent { @@ -15167,7 +8479,7 @@ pub struct TrialComponent { #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] pub environment_variables: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, + pub resources: Option, } impl TrialComponent { pub fn new(command: String, environment_id: String) -> Self { @@ -15182,89 +8494,6 @@ impl TrialComponent { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TriggerBase { - #[doc = "Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601.\r\nRecommented format would be \"2022-06-01T00:00:01\"\r\nIf not present, the schedule will run indefinitely"] - #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "Specifies start time of schedule in ISO 8601 format, but without a UTC offset."] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option, - #[serde(rename = "triggerType")] - pub trigger_type: TriggerType, -} -impl TriggerBase { - pub fn new(trigger_type: TriggerType) -> Self { - Self { - end_time: None, - start_time: None, - time_zone: None, - trigger_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "triggerType")] -pub enum TriggerBaseUnion { - Cron(CronTrigger), - Recurrence(RecurrenceTrigger), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TriggerType")] -pub enum TriggerType { - Recurrence, - Cron, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TriggerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TriggerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TriggerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Recurrence => serializer.serialize_unit_variant("TriggerType", 0u32, "Recurrence"), - Self::Cron => serializer.serialize_unit_variant("TriggerType", 1u32, "Cron"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Triton inferencing server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TritonInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Online inference configuration options."] - #[serde(rename = "inferenceConfiguration", default, skip_serializing_if = "Option::is_none")] - pub inference_configuration: Option, -} -impl TritonInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - inference_configuration: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TritonModelJobInput { #[serde(flatten)] pub asset_job_input: AssetJobInput, @@ -15611,45 +8840,6 @@ impl UsageName { Self::default() } } -#[doc = "Configure STL Decomposition of the time-series target column."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "UseStl")] -pub enum UseStl { - None, - Season, - SeasonTrend, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for UseStl { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for UseStl { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for UseStl { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("UseStl", 0u32, "None"), - Self::Season => serializer.serialize_unit_variant("UseStl", 1u32, "Season"), - Self::SeasonTrend => serializer.serialize_unit_variant("UseStl", 2u32, "SeasonTrend"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Settings for user account that gets created on each on the nodes of a compute."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserAccountCredentials { @@ -15695,28 +8885,6 @@ impl UserAssignedIdentity { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedAcrAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedStorageAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} #[doc = "User identity configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserIdentity { @@ -15743,47 +8911,6 @@ impl UsernamePasswordAuthTypeWorkspaceConnectionProperties { } } } -#[doc = "Metric computation method to use for validation metrics in image tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ValidationMetricType")] -pub enum ValidationMetricType { - None, - Coco, - Voc, - CocoVoc, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ValidationMetricType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ValidationMetricType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ValidationMetricType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ValidationMetricType", 0u32, "None"), - Self::Coco => serializer.serialize_unit_variant("ValidationMetricType", 1u32, "Coco"), - Self::Voc => serializer.serialize_unit_variant("ValidationMetricType", 2u32, "Voc"), - Self::CocoVoc => serializer.serialize_unit_variant("ValidationMetricType", 3u32, "CocoVoc"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "A Machine Learning compute based on Azure Virtual Machines."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VirtualMachine { @@ -15961,146 +9088,6 @@ impl VirtualMachineSshCredentials { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeDefinition { - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Indicate whether to mount volume as readOnly. Default value for this is false."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option, - #[doc = "Source of the mount. For bind mounts this is the host path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Target of the mount. For bind mounts this is the path in the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Consistency of the volume"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub consistency: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bind: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub volume: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tmpfs: Option, -} -impl VolumeDefinition { - pub fn new() -> Self { - Self::default() - } -} -pub mod volume_definition { - use super::*; - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "bind")] - Bind, - #[serde(rename = "volume")] - Volume, - #[serde(rename = "tmpfs")] - Tmpfs, - #[serde(rename = "npipe")] - Npipe, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bind => serializer.serialize_unit_variant("Type", 0u32, "bind"), - Self::Volume => serializer.serialize_unit_variant("Type", 1u32, "volume"), - Self::Tmpfs => serializer.serialize_unit_variant("Type", 2u32, "tmpfs"), - Self::Npipe => serializer.serialize_unit_variant("Type", 3u32, "npipe"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Bind - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeOptions { - #[doc = "Indicate whether volume is nocopy"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nocopy: Option, -} -impl VolumeOptions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum of weekday"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "WeekDay")] -pub enum WeekDay { - Monday, - Tuesday, - Wednesday, - Thursday, - Friday, - Saturday, - Sunday, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for WeekDay { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for WeekDay { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for WeekDay { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Monday => serializer.serialize_unit_variant("WeekDay", 0u32, "Monday"), - Self::Tuesday => serializer.serialize_unit_variant("WeekDay", 1u32, "Tuesday"), - Self::Wednesday => serializer.serialize_unit_variant("WeekDay", 2u32, "Wednesday"), - Self::Thursday => serializer.serialize_unit_variant("WeekDay", 3u32, "Thursday"), - Self::Friday => serializer.serialize_unit_variant("WeekDay", 4u32, "Friday"), - Self::Saturday => serializer.serialize_unit_variant("WeekDay", 5u32, "Saturday"), - Self::Sunday => serializer.serialize_unit_variant("WeekDay", 6u32, "Sunday"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "An object that represents a machine learning workspace."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Workspace { @@ -16121,8 +9108,6 @@ pub struct Workspace { #[doc = "The resource model definition representing SKU"] #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, } impl Workspace { pub fn new() -> Self { @@ -16130,18 +9115,6 @@ impl Workspace { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionAccessKey { - #[serde(rename = "accessKeyId", default, skip_serializing_if = "Option::is_none")] - pub access_key_id: Option, - #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, -} -impl WorkspaceConnectionAccessKey { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceConnectionManagedIdentity { #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] pub resource_id: Option, @@ -16233,14 +9206,12 @@ pub mod workspace_connection_properties_v2 { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(tag = "authType")] pub enum WorkspaceConnectionPropertiesV2Union { - AccessKey(AccessKeyAuthTypeWorkspaceConnectionProperties), ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), None(NoneAuthTypeWorkspaceConnectionProperties), #[serde(rename = "PAT")] Pat(PatAuthTypeWorkspaceConnectionProperties), #[serde(rename = "SAS")] Sas(SasAuthTypeWorkspaceConnectionProperties), - ServicePrincipal(ServicePrincipalAuthTypeWorkspaceConnectionProperties), UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -16280,20 +9251,6 @@ impl WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionServicePrincipal { - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, -} -impl WorkspaceConnectionServicePrincipal { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceConnectionSharedAccessSignature { #[serde(default, skip_serializing_if = "Option::is_none")] pub sas: Option, @@ -16425,20 +9382,6 @@ pub struct WorkspaceProperties { #[doc = "Enabling v1_legacy_mode may prevent you from using features provided by the v2 API."] #[serde(rename = "v1LegacyMode", default, skip_serializing_if = "Option::is_none")] pub v1_legacy_mode: Option, - #[doc = "The timestamp when the workspace was soft deleted"] - #[serde(rename = "softDeletedAt", default, skip_serializing_if = "Option::is_none")] - pub soft_deleted_at: Option, - #[doc = "The timestamp when the soft deleted workspace is going to be purged"] - #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")] - pub scheduled_purge_date: Option, - #[doc = "The auth mode used for accessing the system datastores of the workspace"] - #[serde(rename = "systemDatastoresAuthMode", default, skip_serializing_if = "Option::is_none")] - pub system_datastores_auth_mode: Option, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, - #[doc = "Retention time in days after workspace get soft deleted."] - #[serde(rename = "softDeleteRetentionInDays", default, skip_serializing_if = "Option::is_none")] - pub soft_delete_retention_in_days: Option, } impl WorkspaceProperties { pub fn new() -> Self { @@ -16458,7 +9401,6 @@ pub mod workspace_properties { Succeeded, Failed, Canceled, - SoftDeleted, #[serde(skip_deserializing)] UnknownValue(String), } @@ -16491,7 +9433,6 @@ pub mod workspace_properties { Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), - Self::SoftDeleted => serializer.serialize_unit_variant("ProvisioningState", 7u32, "SoftDeleted"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -16560,10 +9501,6 @@ pub struct WorkspacePropertiesUpdateParameters { #[doc = "ARM id of the container registry associated with this workspace."] #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] pub container_registry: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encryption: Option, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, } impl WorkspacePropertiesUpdateParameters { pub fn new() -> Self { diff --git a/services/mgmt/machinelearningservices/src/package_preview_2022_10/mod.rs b/services/mgmt/machinelearningservices/src/package_2022_10/mod.rs similarity index 70% rename from services/mgmt/machinelearningservices/src/package_preview_2022_10/mod.rs rename to services/mgmt/machinelearningservices/src/package_2022_10/mod.rs index 5b7e826f24..ffc386b293 100644 --- a/services/mgmt/machinelearningservices/src/package_preview_2022_10/mod.rs +++ b/services/mgmt/machinelearningservices/src/package_2022_10/mod.rs @@ -142,9 +142,6 @@ impl Client { pub fn jobs_client(&self) -> jobs::Client { jobs::Client(self.clone()) } - pub fn labeling_jobs_client(&self) -> labeling_jobs::Client { - labeling_jobs::Client(self.clone()) - } pub fn model_containers_client(&self) -> model_containers::Client { model_containers::Client(self.clone()) } @@ -169,33 +166,6 @@ impl Client { pub fn quotas_client(&self) -> quotas::Client { quotas::Client(self.clone()) } - pub fn registries_client(&self) -> registries::Client { - registries::Client(self.clone()) - } - pub fn registry_code_containers_client(&self) -> registry_code_containers::Client { - registry_code_containers::Client(self.clone()) - } - pub fn registry_code_versions_client(&self) -> registry_code_versions::Client { - registry_code_versions::Client(self.clone()) - } - pub fn registry_component_containers_client(&self) -> registry_component_containers::Client { - registry_component_containers::Client(self.clone()) - } - pub fn registry_component_versions_client(&self) -> registry_component_versions::Client { - registry_component_versions::Client(self.clone()) - } - pub fn registry_environment_containers_client(&self) -> registry_environment_containers::Client { - registry_environment_containers::Client(self.clone()) - } - pub fn registry_environment_versions_client(&self) -> registry_environment_versions::Client { - registry_environment_versions::Client(self.clone()) - } - pub fn registry_model_containers_client(&self) -> registry_model_containers::Client { - registry_model_containers::Client(self.clone()) - } - pub fn registry_model_versions_client(&self) -> registry_model_versions::Client { - registry_model_versions::Client(self.clone()) - } pub fn schedules_client(&self) -> schedules::Client { schedules::Client(self.clone()) } @@ -223,7 +193,7 @@ pub mod operations { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all of the available Azure Machine Learning Services REST API operations."] + #[doc = "Lists all of the available Azure Machine Learning Workspaces REST API operations."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } @@ -314,7 +284,7 @@ pub mod operations { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -683,7 +653,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -792,7 +762,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -929,7 +899,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1059,7 +1029,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1148,7 +1118,7 @@ pub mod workspaces { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1192,7 +1162,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1307,7 +1277,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1404,7 +1374,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1507,7 +1477,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1595,7 +1565,7 @@ pub mod workspaces { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1638,7 +1608,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1729,7 +1699,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -1837,7 +1807,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2003,7 +1973,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2112,7 +2082,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2214,7 +2184,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2331,7 +2301,7 @@ pub mod usages { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2372,7 +2342,7 @@ pub mod usages { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2488,7 +2458,7 @@ pub mod virtual_machine_sizes { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2637,7 +2607,7 @@ pub mod quotas { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2732,7 +2702,7 @@ pub mod quotas { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2773,7 +2743,7 @@ pub mod quotas { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -2905,31 +2875,6 @@ pub mod compute { underlying_resource_action: underlying_resource_action.into(), } } - #[doc = "Updates the custom services list. The list of custom services provided shall be overwritten"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `custom_services`: New list of Custom Services."] - pub fn update_custom_services( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - custom_services: Vec, - ) -> update_custom_services::RequestBuilder { - update_custom_services::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - custom_services, - } - } #[doc = "Get the details (e.g IP address, port etc) of all the compute nodes in the compute."] #[doc = ""] #[doc = "Arguments:"] @@ -3040,31 +2985,6 @@ pub mod compute { compute_name: compute_name.into(), } } - #[doc = "Updates the idle shutdown setting of a compute instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: The object for updating idle shutdown setting of specified ComputeInstance."] - pub fn update_idle_shutdown_setting( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> update_idle_shutdown_setting::RequestBuilder { - update_idle_shutdown_setting::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } } pub mod list { use super::models; @@ -3150,7 +3070,7 @@ pub mod compute { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3195,7 +3115,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -3293,7 +3213,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -3415,7 +3335,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -3554,7 +3474,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -3706,95 +3626,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod update_custom_services { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) custom_services: Vec, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.custom_services)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/customServices" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -3879,7 +3711,7 @@ pub mod compute { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3923,7 +3755,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4022,7 +3854,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4127,7 +3959,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4220,7 +4052,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4313,95 +4145,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod update_idle_shutdown_setting { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::IdleShutdownSetting, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/updateIdleShutdownSetting" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4591,7 +4335,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4682,7 +4426,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4787,7 +4531,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -4885,7 +4629,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -5010,7 +4754,7 @@ pub mod private_link_resources { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -5212,7 +4956,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -5324,7 +5068,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -5429,7 +5173,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -5528,7 +5272,7 @@ pub mod workspace_connections { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5576,14 +5320,14 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod registry_code_containers { +pub mod batch_endpoints { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -5591,94 +5335,142 @@ pub mod registry_code_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List containers."] + #[doc = "Lists Batch inference endpoint in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + count: None, skip: None, } } - #[doc = "Get container."] + #[doc = "Gets a batch inference endpoint by name."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates a batch inference endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] + #[doc = "* `body`: Batch inference endpoint definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - body: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Update a batch inference endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - pub fn delete( + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] + #[doc = "* `body`: Mutable batch inference endpoint definition object."] + pub fn update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - } + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), + } + } + #[doc = "Delete Batch Inference Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference Endpoint name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } + } + #[doc = "Lists batch Inference Endpoint keys."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference Endpoint name."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } } } pub mod list { @@ -5690,9 +5482,9 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5735,16 +5527,24 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) count: Option, pub(crate) skip: Option, } impl RequestBuilder { + #[doc = "Number of endpoints to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -5765,7 +5565,7 @@ pub mod registry_code_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5779,6 +5579,9 @@ pub mod registry_code_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -5801,16 +5604,16 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -5825,9 +5628,9 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5870,8 +5673,8 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5898,24 +5701,24 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5935,9 +5738,9 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5979,16 +5782,13 @@ pub mod registry_code_containers { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] #[doc = r" until the operation completes, use"] @@ -5998,9 +5798,9 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) body: models::CodeContainerResource, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) body: models::BatchEndpointTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6028,37 +5828,63 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod delete { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6067,6 +5893,11 @@ pub mod registry_code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -6125,8 +5956,9 @@ pub mod registry_code_containers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6138,14 +5970,15 @@ pub mod registry_code_containers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -6153,164 +5986,105 @@ pub mod registry_code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } } -} -pub mod registry_code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - order_by: None, - top: None, - skip: None, + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) } } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) } } #[derive(Clone)] @@ -6319,125 +6093,67 @@ pub mod registry_code_versions { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name, - &self.code_name + &self.workspace_name, + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } - pub mod get { + pub mod list_keys { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -6446,9 +6162,9 @@ pub mod registry_code_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; + let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6491,9 +6207,8 @@ pub mod registry_code_versions { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6505,7 +6220,7 @@ pub mod registry_code_versions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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( @@ -6513,32 +6228,25 @@ pub mod registry_code_versions { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6549,6791 +6257,8 @@ pub mod registry_code_versions { } } } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_component_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) body: models::ComponentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_environment_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List environment containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) body: models::EnvironmentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_environment_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_model_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - } - } - #[doc = "Create or update model container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) body: models::ModelContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_model_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - skip: None, - order_by: None, - top: None, - version: None, - description: None, - tags: None, - properties: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Version identifier."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod batch_endpoints { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference endpoint in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - count: None, - skip: None, - } - } - #[doc = "Gets a batch inference endpoint by name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Creates a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Batch inference endpoint definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Mutable batch inference endpoint definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Lists batch Inference Endpoint keys."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::BatchEndpointTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod batch_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference deployments in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Gets a batch inference deployment by id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch deployments."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Creates/updates a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: Inference deployment identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::BatchDeploymentTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::CodeContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } } -pub mod component_containers { +pub mod batch_deployments { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13341,94 +6266,135 @@ pub mod component_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List component containers."] + #[doc = "Lists Batch inference deployments in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Endpoint name"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + endpoint_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + order_by: None, + top: None, skip: None, - list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Gets a batch inference deployment by id."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] + #[doc = "* `endpoint_name`: Endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch deployments."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates/updates a batch inference deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `endpoint_name`: Inference endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] + #[doc = "* `body`: Batch inference deployment definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - body: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Update a batch inference deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] + #[doc = "* `endpoint_name`: Inference endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] + #[doc = "* `body`: Batch inference deployment definition object."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), + } + } + #[doc = "Delete Batch Inference deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Endpoint name"] + #[doc = "* `deployment_name`: Inference deployment identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } } @@ -13441,9 +6407,9 @@ pub mod component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13487,23 +6453,30 @@ pub mod component_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Top of list."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } pub fn into_stream( self, - ) -> azure_core::Pageable { + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -13524,7 +6497,7 @@ pub mod component_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13538,12 +6511,15 @@ pub mod component_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -13562,17 +6538,11 @@ pub mod component_containers { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -13587,9 +6557,9 @@ pub mod component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13633,7 +6603,8 @@ pub mod component_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13659,36 +6630,178 @@ pub mod component_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BatchDeploymentTrackedResource = 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 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::BatchDeploymentTrackedResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod create_or_update { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13697,9 +6810,9 @@ pub mod component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13708,6 +6821,9 @@ pub mod component_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -13719,32 +6835,48 @@ pub mod component_containers { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ComponentContainerResource, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13756,7 +6888,7 @@ pub mod component_containers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + 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( @@ -13771,32 +6903,53 @@ pub mod component_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } @@ -13815,6 +6968,9 @@ pub mod component_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -13826,31 +6982,47 @@ pub mod component_containers { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13876,25 +7048,18 @@ pub mod component_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod component_versions { +pub mod code_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13902,47 +7067,39 @@ pub mod component_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List component versions."] + #[doc = "List containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Component name."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, skip: None, - list_view_type: None, } } - #[doc = "Get version."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -13950,26 +7107,23 @@ pub mod component_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } - #[doc = "Create or update version."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -13977,25 +7131,22 @@ pub mod component_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -14003,7 +7154,6 @@ pub mod component_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } } @@ -14016,9 +7166,9 @@ pub mod component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14062,34 +7212,15 @@ pub mod component_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -14110,7 +7241,7 @@ pub mod component_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14124,18 +7255,9 @@ pub mod component_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -14154,11 +7276,17 @@ pub mod component_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -14173,9 +7301,9 @@ pub mod component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14220,7 +7348,6 @@ pub mod component_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14246,18 +7373,25 @@ pub mod component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14277,9 +7411,9 @@ pub mod component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14324,8 +7458,7 @@ pub mod component_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, + pub(crate) body: models::CodeContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14352,18 +7485,25 @@ pub mod component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14425,7 +7565,6 @@ pub mod component_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14451,18 +7590,25 @@ pub mod component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod data_containers { +pub mod code_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -14470,40 +7616,46 @@ pub mod data_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List data containers."] + #[doc = "List versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, skip: None, - list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -14511,23 +7663,26 @@ pub mod data_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } - #[doc = "Create or update container."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - body: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -14535,22 +7690,25 @@ pub mod data_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -14558,6 +7716,7 @@ pub mod data_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } } @@ -14570,9 +7729,9 @@ pub mod data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14616,21 +7775,28 @@ pub mod data_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -14651,7 +7817,7 @@ pub mod data_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14665,12 +7831,15 @@ pub mod data_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -14690,16 +7859,17 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -14714,9 +7884,9 @@ pub mod data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14761,6 +7931,7 @@ pub mod data_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14787,24 +7958,25 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14824,9 +7996,9 @@ pub mod data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14871,7 +8043,8 @@ pub mod data_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::DataContainerResource, + pub(crate) version: String, + pub(crate) body: models::CodeVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14899,24 +8072,25 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14978,6 +8152,7 @@ pub mod data_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15004,24 +8179,25 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod data_versions { +pub mod component_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -15029,48 +8205,40 @@ pub mod data_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List data versions in the data container"] + #[doc = "List component containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Data container's name"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, skip: None, - tags: None, list_view_type: None, } } - #[doc = "Get version."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -15078,26 +8246,23 @@ pub mod data_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } - #[doc = "Create or update version."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15105,25 +8270,22 @@ pub mod data_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -15131,7 +8293,6 @@ pub mod data_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } } @@ -15144,9 +8305,9 @@ pub mod data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15190,40 +8351,23 @@ pub mod data_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) tags: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] + #[doc = "View type for including/excluding (for example) archived entities."] pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -15244,7 +8388,7 @@ pub mod data_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15258,18 +8402,9 @@ pub mod data_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -15292,17 +8427,16 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -15317,9 +8451,9 @@ pub mod data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15364,7 +8498,6 @@ pub mod data_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15391,25 +8524,24 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -15429,9 +8561,9 @@ pub mod data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15476,8 +8608,7 @@ pub mod data_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, + pub(crate) body: models::ComponentContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15505,25 +8636,24 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -15585,7 +8715,6 @@ pub mod data_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15612,25 +8741,24 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod datastores { +pub mod component_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -15638,45 +8766,47 @@ pub mod datastores { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List datastores."] + #[doc = "List component versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Component name."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - skip: None, - count: None, - is_default: None, - names: Vec::new(), - search_text: None, + name: name.into(), order_by: None, - order_by_asc: None, + top: None, + skip: None, + list_view_type: None, } } - #[doc = "Get datastore."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -15684,23 +8814,26 @@ pub mod datastores { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } - #[doc = "Create or update datastore."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - #[doc = "* `body`: Datastore entity to create or update."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - body: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15708,23 +8841,25 @@ pub mod datastores { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), body: body.into(), - skip_validation: None, } } - #[doc = "Delete datastore."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -15732,28 +8867,7 @@ pub mod datastores { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - } - } - #[doc = "Get datastore secrets."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn list_secrets( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), + version: version.into(), } } } @@ -15766,9 +8880,9 @@ pub mod datastores { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15812,51 +8926,34 @@ pub mod datastores { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) is_default: Option, - pub(crate) names: Vec, - pub(crate) search_text: Option, + pub(crate) name: String, pub(crate) order_by: Option, - pub(crate) order_by_asc: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Filter down to the workspace default datastore."] - pub fn is_default(mut self, is_default: bool) -> Self { - self.is_default = Some(is_default); - self - } - #[doc = "Names of datastores to return."] - pub fn names(mut self, names: Vec) -> Self { - self.names = names; + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); self } - #[doc = "Text to search for in the datastore names."] - pub fn search_text(mut self, search_text: impl Into) -> Self { - self.search_text = Some(search_text.into()); + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); self } - #[doc = "Order by property (createdtime | modifiedtime | name)."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); self } - #[doc = "Order by property in ascending order."] - pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { - self.order_by_asc = Some(order_by_asc); + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -15877,7 +8974,7 @@ pub mod datastores { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15891,169 +8988,47 @@ pub mod datastores { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(is_default) = &this.is_default { - req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); - } - if let Some(search_text) = &this.search_text { - req.url_mut().query_pairs_mut().append_pair("searchText", search_text); - } if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); } - if let Some(order_by_asc) = &this.order_by_asc { - req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } + 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) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod create_or_update { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -16062,9 +9037,9 @@ pub mod datastores { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16109,15 +9084,9 @@ pub mod datastores { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::DatastoreResource, - pub(crate) skip_validation: Option, + pub(crate) version: String, } impl RequestBuilder { - #[doc = "Flag to skip validation."] - pub fn skip_validation(mut self, skip_validation: bool) -> Self { - self.skip_validation = Some(skip_validation); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16127,45 +9096,32 @@ pub mod datastores { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + 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()), ); - if let Some(skip_validation) = &this.skip_validation { - req.url_mut() - .query_pairs_mut() - .append_pair("skipValidation", &skip_validation.to_string()); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16176,7 +9132,7 @@ pub mod datastores { } } } - pub mod delete { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -16185,6 +9141,11 @@ pub mod datastores { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -16227,6 +9188,8 @@ pub mod datastores { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::ComponentVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -16238,38 +9201,44 @@ pub mod datastores { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod list_secrets { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -16278,11 +9247,6 @@ pub mod datastores { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreSecretsUnion = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -16325,6 +9289,7 @@ pub mod datastores { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -16336,7 +9301,7 @@ pub mod datastores { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -16344,37 +9309,24 @@ pub mod datastores { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod environment_containers { +pub mod data_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -16382,7 +9334,7 @@ pub mod environment_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List environment containers."] + #[doc = "List data containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -16409,7 +9361,7 @@ pub mod environment_containers { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `name`: Container name."] pub fn get( &self, subscription_id: impl Into, @@ -16431,7 +9383,7 @@ pub mod environment_containers { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `name`: Container name."] #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, @@ -16439,7 +9391,7 @@ pub mod environment_containers { resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -16456,7 +9408,7 @@ pub mod environment_containers { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `name`: Container name."] pub fn delete( &self, subscription_id: impl Into, @@ -16482,9 +9434,9 @@ pub mod environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16542,9 +9494,7 @@ pub mod environment_containers { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -16565,7 +9515,7 @@ pub mod environment_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -16604,7 +9554,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16613,7 +9563,7 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -16628,9 +9578,9 @@ pub mod environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16701,7 +9651,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16711,14 +9661,14 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16738,9 +9688,9 @@ pub mod environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16785,7 +9735,7 @@ pub mod environment_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::EnvironmentContainerResource, + pub(crate) body: models::DataContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -16813,7 +9763,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16823,14 +9773,14 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16918,7 +9868,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16928,14 +9878,14 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod environment_versions { +pub mod data_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -16943,13 +9893,13 @@ pub mod environment_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List versions."] + #[doc = "List data versions in the data container"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `name`: Data container's name"] pub fn list( &self, subscription_id: impl Into, @@ -16966,6 +9916,7 @@ pub mod environment_versions { order_by: None, top: None, skip: None, + tags: None, list_view_type: None, } } @@ -16975,8 +9926,8 @@ pub mod environment_versions { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, @@ -16994,15 +9945,15 @@ pub mod environment_versions { version: version.into(), } } - #[doc = "Creates or updates an EnvironmentVersion."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] - #[doc = "* `version`: Version of EnvironmentVersion."] - #[doc = "* `body`: Definition of EnvironmentVersion."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, @@ -17010,7 +9961,7 @@ pub mod environment_versions { workspace_name: impl Into, name: impl Into, version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -17028,8 +9979,8 @@ pub mod environment_versions { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, @@ -17057,9 +10008,9 @@ pub mod environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17107,15 +10058,16 @@ pub mod environment_versions { pub(crate) order_by: Option, pub(crate) top: Option, pub(crate) skip: Option, + pub(crate) tags: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] + #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] pub fn order_by(mut self, order_by: impl Into) -> Self { self.order_by = Some(order_by.into()); self } - #[doc = "Maximum number of records to return."] + #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self @@ -17125,14 +10077,17 @@ pub mod environment_versions { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -17153,7 +10108,7 @@ pub mod environment_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17176,6 +10131,9 @@ pub mod environment_versions { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("$tags", tags); + } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -17197,11 +10155,18 @@ pub mod environment_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -17216,9 +10181,9 @@ pub mod environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17289,18 +10254,26 @@ pub mod environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17320,9 +10293,9 @@ pub mod environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17368,7 +10341,7 @@ pub mod environment_versions { pub(crate) workspace_name: String, pub(crate) name: String, pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, + pub(crate) body: models::DataVersionBaseResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -17395,18 +10368,26 @@ pub mod environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17494,18 +10475,26 @@ pub mod environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod jobs { +pub mod datastores { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -17513,7 +10502,7 @@ pub mod jobs { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists Jobs in the workspace."] + #[doc = "List datastores."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -17531,102 +10520,104 @@ pub mod jobs { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), skip: None, - job_type: None, - tag: None, - list_view_type: None, - scheduled: None, - schedule_id: None, + count: None, + is_default: None, + names: Vec::new(), + search_text: None, + order_by: None, + order_by_asc: None, } } - #[doc = "Gets a Job by name/id."] + #[doc = "Get datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + #[doc = "* `name`: Datastore name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), } } - #[doc = "Creates and executes a Job."] + #[doc = "Create or update datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - #[doc = "* `body`: Job definition object."] + #[doc = "* `name`: Datastore name."] + #[doc = "* `body`: Datastore entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, - body: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), body: body.into(), + skip_validation: None, } } - #[doc = "Deletes a Job (asynchronous)."] + #[doc = "Delete datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + #[doc = "* `name`: Datastore name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), } } - #[doc = "Cancels a Job (asynchronous)."] + #[doc = "Get datastore secrets."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn cancel( + #[doc = "* `name`: Datastore name."] + pub fn list_secrets( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, - ) -> cancel::RequestBuilder { - cancel::RequestBuilder { + name: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), } } } @@ -17639,9 +10630,9 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17686,11 +10677,12 @@ pub mod jobs { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) skip: Option, - pub(crate) job_type: Option, - pub(crate) tag: Option, - pub(crate) list_view_type: Option, - pub(crate) scheduled: Option, - pub(crate) schedule_id: Option, + pub(crate) count: Option, + pub(crate) is_default: Option, + pub(crate) names: Vec, + pub(crate) search_text: Option, + pub(crate) order_by: Option, + pub(crate) order_by_asc: Option, } impl RequestBuilder { #[doc = "Continuation token for pagination."] @@ -17698,32 +10690,37 @@ pub mod jobs { self.skip = Some(skip.into()); self } - #[doc = "Type of job to be returned."] - pub fn job_type(mut self, job_type: impl Into) -> Self { - self.job_type = Some(job_type.into()); + #[doc = "Maximum number of results to return."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); self } - #[doc = "Jobs returned will have this tag key."] - pub fn tag(mut self, tag: impl Into) -> Self { - self.tag = Some(tag.into()); + #[doc = "Filter down to the workspace default datastore."] + pub fn is_default(mut self, is_default: bool) -> Self { + self.is_default = Some(is_default); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); + #[doc = "Names of datastores to return."] + pub fn names(mut self, names: Vec) -> Self { + self.names = names; self } - #[doc = "Indicator whether the job is scheduled job."] - pub fn scheduled(mut self, scheduled: bool) -> Self { - self.scheduled = Some(scheduled); + #[doc = "Text to search for in the datastore names."] + pub fn search_text(mut self, search_text: impl Into) -> Self { + self.search_text = Some(search_text.into()); self } - #[doc = "The scheduled id for listing the job triggered from"] - pub fn schedule_id(mut self, schedule_id: impl Into) -> Self { - self.schedule_id = Some(schedule_id.into()); + #[doc = "Order by property (createdtime | modifiedtime | name)."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Order by property in ascending order."] + pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { + self.order_by_asc = Some(order_by_asc); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -17744,7 +10741,7 @@ pub mod jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17761,20 +10758,20 @@ pub mod jobs { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(job_type) = &this.job_type { - req.url_mut().query_pairs_mut().append_pair("jobType", job_type); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); } - if let Some(tag) = &this.tag { - req.url_mut().query_pairs_mut().append_pair("tag", tag); + if let Some(is_default) = &this.is_default { + req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + if let Some(search_text) = &this.search_text { + req.url_mut().query_pairs_mut().append_pair("searchText", search_text); } - if let Some(scheduled) = &this.scheduled { - req.url_mut().query_pairs_mut().append_pair("scheduled", &scheduled.to_string()); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); } - if let Some(schedule_id) = &this.schedule_id { - req.url_mut().query_pairs_mut().append_pair("scheduleId", schedule_id); + if let Some(order_by_asc) = &this.order_by_asc { + req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17795,7 +10792,7 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -17804,7 +10801,7 @@ pub mod jobs { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -17819,9 +10816,9 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17865,7 +10862,7 @@ pub mod jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -17892,24 +10889,24 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17929,9 +10926,9 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17975,10 +10972,16 @@ pub mod jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::JobBaseResource, + pub(crate) name: String, + pub(crate) body: models::DatastoreResource, + pub(crate) skip_validation: Option, } impl RequestBuilder { + #[doc = "Flag to skip validation."] + pub fn skip_validation(mut self, skip_validation: bool) -> Self { + self.skip_validation = Some(skip_validation); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17995,6 +10998,11 @@ pub mod jobs { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(skip_validation) = &this.skip_validation { + req.url_mut() + .query_pairs_mut() + .append_pair("skipValidation", &skip_validation.to_string()); + } req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -18004,24 +11012,24 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -18047,9 +11055,6 @@ pub mod jobs { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -18061,46 +11066,31 @@ pub mod jobs { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -18127,23 +11117,23 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } - pub mod cancel { + pub mod list_secrets { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -18152,15 +11142,17 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DatastoreSecretsUnion = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -18169,18 +11161,7 @@ pub mod jobs { } impl AsRef for Response { fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + self.as_raw_response() } } #[derive(Clone)] @@ -18189,24 +11170,25 @@ pub mod jobs { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -18233,25 +11215,30 @@ pub mod jobs { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod labeling_jobs { +pub mod environment_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -18259,7 +11246,7 @@ pub mod labeling_jobs { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists labeling jobs in the workspace."] + #[doc = "List environment containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -18277,295 +11264,80 @@ pub mod labeling_jobs { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), skip: None, - count: None, + list_view_type: None, } } - #[doc = "Gets a labeling job by name/id."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), - include_job_instructions: None, - include_label_categories: None, + name: name.into(), } } - #[doc = "Creates or updates a labeling job (asynchronous)."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: LabelingJob definition object."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, - body: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), body: body.into(), } } - #[doc = "Delete a labeling job."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Export labels from a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: The export summary."] - pub fn export_labels( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> export_labels::RequestBuilder { - export_labels::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Pause a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn pause( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> pause::RequestBuilder { - pause::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Resume a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn resume( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Number of labeling jobs to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) + workspace_name: workspace_name.into(), + name: name.into(), } } } - pub mod get { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -18574,9 +11346,9 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18620,239 +11392,98 @@ pub mod labeling_jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) include_job_instructions: Option, - pub(crate) include_label_categories: Option, + pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Boolean value to indicate whether to include JobInstructions in response."] - pub fn include_job_instructions(mut self, include_job_instructions: bool) -> Self { - self.include_job_instructions = Some(include_job_instructions); + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); self } - #[doc = "Boolean value to indicate Whether to include LabelCategories in response."] - pub fn include_label_categories(mut self, include_label_categories: bool) -> Self { - self.include_label_categories = Some(include_label_categories); + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(include_job_instructions) = &this.include_job_instructions { - req.url_mut() - .query_pairs_mut() - .append_pair("includeJobInstructions", &include_job_instructions.to_string()); - } - if let Some(include_label_categories) = &this.include_label_categories { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLabelCategories", &include_label_categories.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::LabelingJobResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream( + self, + ) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2022-10-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } + 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) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.id + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } } - pub mod delete { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -18861,6 +11492,11 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -18902,7 +11538,7 @@ pub mod labeling_jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -18914,7 +11550,7 @@ pub mod labeling_jobs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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( @@ -18929,23 +11565,35 @@ pub mod labeling_jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod export_labels { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -18954,9 +11602,9 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ExportSummaryUnion = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18965,9 +11613,6 @@ pub mod labeling_jobs { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -18979,42 +11624,32 @@ pub mod labeling_jobs { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::ExportSummaryUnion, + pub(crate) name: String, + pub(crate) body: models::EnvironmentContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19026,7 +11661,7 @@ pub mod labeling_jobs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -19041,92 +11676,36 @@ pub mod labeling_jobs { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/exportLabels" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod pause { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19176,7 +11755,7 @@ pub mod labeling_jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19188,7 +11767,7 @@ pub mod labeling_jobs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -19196,7 +11775,6 @@ pub mod labeling_jobs { format!("Bearer {}", token_response.token.secret()), ); 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?)) } @@ -19204,124 +11782,24 @@ pub mod labeling_jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/pause", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) - } - } - } - pub mod resume { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/resume" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod model_containers { +pub mod environment_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19329,41 +11807,47 @@ pub mod model_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List model containers."] + #[doc = "List versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, skip: None, - count: None, list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -19371,23 +11855,26 @@ pub mod model_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates or updates an EnvironmentVersion."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] + #[doc = "* `version`: Version of EnvironmentVersion."] + #[doc = "* `body`: Definition of EnvironmentVersion."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - body: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -19395,22 +11882,25 @@ pub mod model_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -19418,6 +11908,7 @@ pub mod model_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } } @@ -19430,9 +11921,9 @@ pub mod model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19476,27 +11967,36 @@ pub mod model_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) count: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } #[doc = "View type for including/excluding (for example) archived entities."] pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -19517,7 +12017,7 @@ pub mod model_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -19531,12 +12031,15 @@ pub mod model_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -19558,17 +12061,11 @@ pub mod model_containers { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -19583,9 +12080,9 @@ pub mod model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19630,6 +12127,7 @@ pub mod model_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19655,25 +12153,18 @@ pub mod model_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -19693,9 +12184,9 @@ pub mod model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19740,7 +12231,8 @@ pub mod model_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::ModelContainerResource, + pub(crate) version: String, + pub(crate) body: models::EnvironmentVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19767,25 +12259,18 @@ pub mod model_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -19847,6 +12332,7 @@ pub mod model_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19872,25 +12358,18 @@ pub mod model_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod model_versions { +pub mod jobs { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19898,114 +12377,118 @@ pub mod model_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List model versions."] + #[doc = "Lists Jobs in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Model name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), skip: None, - order_by: None, - top: None, - version: None, - description: None, - offset: None, - tags: None, - properties: None, - feed: None, + job_type: None, + tag: None, list_view_type: None, } } - #[doc = "Get version."] + #[doc = "Gets a Job by name/id."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - version: impl Into, + id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), + id: id.into(), } } - #[doc = "Create or update version."] + #[doc = "Creates and executes a Job."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + #[doc = "* `body`: Job definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, + id: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), + id: id.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Deletes a Job (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - version: impl Into, + id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), + id: id.into(), + } + } + #[doc = "Cancels a Job (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + pub fn cancel( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + id: impl Into, + ) -> cancel::RequestBuilder { + cancel::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + id: id.into(), } } } @@ -20018,9 +12501,9 @@ pub mod model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20051,75 +12534,38 @@ pub mod model_versions { #[doc = r" executes the request and returns a `Result` with the parsed"] #[doc = r" response."] #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) offset: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) feed: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Model version."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Number of initial results to skip."] - pub fn offset(mut self, offset: i32) -> Self { - self.offset = Some(offset); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) skip: Option, + pub(crate) job_type: Option, + pub(crate) tag: Option, + pub(crate) list_view_type: Option, + } + impl RequestBuilder { + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); self } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); + #[doc = "Type of job to be returned."] + pub fn job_type(mut self, job_type: impl Into) -> Self { + self.job_type = Some(job_type.into()); self } - #[doc = "Name of the feed."] - pub fn feed(mut self, feed: impl Into) -> Self { - self.feed = Some(feed.into()); + #[doc = "Jobs returned will have this tag key."] + pub fn tag(mut self, tag: impl Into) -> Self { + self.tag = Some(tag.into()); self } #[doc = "View type for including/excluding (for example) archived entities."] @@ -20127,7 +12573,7 @@ pub mod model_versions { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -20148,7 +12594,7 @@ pub mod model_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -20165,29 +12611,11 @@ pub mod model_versions { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(offset) = &this.offset { - req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); + if let Some(job_type) = &this.job_type { + req.url_mut().query_pairs_mut().append_pair("jobType", job_type); } - if let Some(feed) = &this.feed { - req.url_mut().query_pairs_mut().append_pair("feed", feed); + if let Some(tag) = &this.tag { + req.url_mut().query_pairs_mut().append_pair("tag", tag); } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); @@ -20211,17 +12639,16 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -20236,9 +12663,9 @@ pub mod model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20282,8 +12709,7 @@ pub mod model_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, + pub(crate) id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20310,25 +12736,24 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -20348,9 +12773,9 @@ pub mod model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20394,9 +12819,8 @@ pub mod model_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, + pub(crate) id: String, + pub(crate) body: models::JobBaseResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20424,25 +12848,24 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -20468,6 +12891,9 @@ pub mod model_versions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -20479,32 +12905,46 @@ pub mod model_versions { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, + pub(crate) id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20531,25 +12971,131 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); + } + Ok(url) + } + } + } + pub mod cancel { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod online_endpoints { +pub mod model_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -20557,7 +13103,7 @@ pub mod online_endpoints { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List Online Endpoints."] + #[doc = "List model containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -20574,176 +13120,78 @@ pub mod online_endpoints { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: None, - count: None, - compute_type: None, skip: None, - tags: None, - properties: None, - order_by: None, + count: None, + list_view_type: None, } } - #[doc = "Get Online Endpoint."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), } } - #[doc = "Create or update Online Endpoint (asynchronous)."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), body: body.into(), } } - #[doc = "Delete Online Endpoint (asynchronous)."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: RegenerateKeys request ."] - pub fn regenerate_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> regenerate_keys::RequestBuilder { - regenerate_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn get_token( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get_token::RequestBuilder { - get_token::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), } } } @@ -20756,9 +13204,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20802,53 +13250,27 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: Option, - pub(crate) count: Option, - pub(crate) compute_type: Option, pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) order_by: Option, + pub(crate) count: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Name of the endpoint."] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "EndpointComputeType to be filtered by."] - pub fn compute_type(mut self, compute_type: impl Into) -> Self { - self.compute_type = Some(compute_type.into()); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); + #[doc = "Maximum number of results to return."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); self } - #[doc = "The option to order the response."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -20869,7 +13291,7 @@ pub mod online_endpoints { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -20883,26 +13305,14 @@ pub mod online_endpoints { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(compute_type) = &this.compute_type { - req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -20923,7 +13333,7 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -20932,7 +13342,7 @@ pub mod online_endpoints { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -20947,9 +13357,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20993,7 +13403,7 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21020,24 +13430,24 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -21057,9 +13467,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21068,9 +13478,6 @@ pub mod online_endpoints { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21082,44 +13489,32 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::OnlineEndpointTrackedResource, + pub(crate) name: String, + pub(crate) body: models::ModelContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21147,63 +13542,35 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21212,20 +13579,12 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21237,47 +13596,31 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21289,15 +13632,14 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -21305,63 +13647,143 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + } +} +pub mod model_versions { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List model versions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Model name. This is case-sensitive."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + skip: None, + order_by: None, + top: None, + version: None, + description: None, + offset: None, + tags: None, + properties: None, + feed: None, + list_view_type: None, + } + } + #[doc = "Get version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), + } + } + #[doc = "Create or update version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Version entity to create or update."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), + body: body.into(), + } + } + #[doc = "Delete version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } } - pub mod delete { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21370,15 +13792,17 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ModelVersionResourceArmPaginatedResult = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21390,89 +13814,194 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, + pub(crate) skip: Option, + pub(crate) order_by: Option, + pub(crate) top: Option, + pub(crate) version: Option, + pub(crate) description: Option, + pub(crate) offset: Option, + pub(crate) tags: Option, + pub(crate) properties: Option, + pub(crate) feed: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Model version."] + pub fn version(mut self, version: impl Into) -> Self { + self.version = Some(version.into()); + self + } + #[doc = "Model description."] + pub fn description(mut self, description: impl Into) -> Self { + self.description = Some(description.into()); + self + } + #[doc = "Number of initial results to skip."] + pub fn offset(mut self, offset: i32) -> Self { + self.offset = Some(offset); + self + } + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] + pub fn properties(mut self, properties: impl Into) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "Name of the feed."] + pub fn feed(mut self, feed: impl Into) -> Self { + self.feed = Some(feed.into()); + self + } + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2022-10-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(version) = &this.version { + req.url_mut().query_pairs_mut().append_pair("version", version); + } + if let Some(description) = &this.description { + req.url_mut().query_pairs_mut().append_pair("description", description); + } + if let Some(offset) = &this.offset { + req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(properties) = &this.properties { + req.url_mut().query_pairs_mut().append_pair("properties", properties); + } + if let Some(feed) = &this.feed { + req.url_mut().query_pairs_mut().append_pair("feed", feed); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } + 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) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } - pub mod list_keys { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21481,9 +14010,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21527,7 +14056,8 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21539,7 +14069,7 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -21547,25 +14077,32 @@ pub mod online_endpoints { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -21576,7 +14113,7 @@ pub mod online_endpoints { } } } - pub mod regenerate_keys { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21585,15 +14122,17 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ModelVersionResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21605,42 +14144,33 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] + #[doc = r" parameters can be chained."] #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::RegenerateEndpointKeysRequest, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::ModelVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21652,7 +14182,7 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -21667,17 +14197,37 @@ pub mod online_endpoints { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_token { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21686,11 +14236,6 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthToken = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -21732,7 +14277,8 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21744,7 +14290,7 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -21752,37 +14298,32 @@ pub mod online_endpoints { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod online_deployments { +pub mod online_endpoints { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21790,46 +14331,45 @@ pub mod online_deployments { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List Inference Endpoint Deployments."] + #[doc = "List Online Endpoints."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, + name: None, + count: None, + compute_type: None, skip: None, + tags: None, + properties: None, + order_by: None, } } - #[doc = "Get Inference Deployment Deployment."] + #[doc = "Get Online Endpoint."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `endpoint_name`: Online Endpoint name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, endpoint_name: impl Into, - deployment_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -21837,26 +14377,23 @@ pub mod online_deployments { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), } } - #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] + #[doc = "Create or update Online Endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Inference Endpoint entity to apply during operation."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -21864,18 +14401,16 @@ pub mod online_deployments { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Update Online Deployment (asynchronous)."] + #[doc = "Update Online Endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] #[doc = "* `body`: Online Endpoint entity to apply during operation."] pub fn update( &self, @@ -21883,8 +14418,7 @@ pub mod online_deployments { resource_group_name: impl Into, workspace_name: impl Into, endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, + body: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), @@ -21892,25 +14426,22 @@ pub mod online_deployments { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] + #[doc = "Delete Online Endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `endpoint_name`: Online Endpoint name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, endpoint_name: impl Into, - deployment_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -21918,62 +14449,75 @@ pub mod online_deployments { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), } } - #[doc = "Polls an Endpoint operation."] + #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: The name and identifier for the endpoint."] - #[doc = "* `body`: The request containing parameters for retrieving logs."] - pub fn get_logs( + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn list_keys( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> get_logs::RequestBuilder { - get_logs::RequestBuilder { + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } + } + #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: RegenerateKeys request ."] + pub fn regenerate_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> regenerate_keys::RequestBuilder { + regenerate_keys::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "List Inference Endpoint Deployment Skus."] + #[doc = "Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn list_skus( + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn get_token( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, endpoint_name: impl Into, - deployment_name: impl Into, - ) -> list_skus::RequestBuilder { - list_skus::RequestBuilder { + ) -> get_token::RequestBuilder { + get_token::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - count: None, - skip: None, } } } @@ -21986,9 +14530,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22032,20 +14576,28 @@ pub mod online_deployments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, + pub(crate) name: Option, + pub(crate) count: Option, + pub(crate) compute_type: Option, pub(crate) skip: Option, + pub(crate) tags: Option, + pub(crate) properties: Option, + pub(crate) order_by: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); + #[doc = "Name of the endpoint."] + pub fn name(mut self, name: impl Into) -> Self { + self.name = Some(name.into()); self } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); + #[doc = "Number of endpoints to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } + #[doc = "EndpointComputeType to be filtered by."] + pub fn compute_type(mut self, compute_type: impl Into) -> Self { + self.compute_type = Some(compute_type.into()); self } #[doc = "Continuation token for pagination."] @@ -22053,9 +14605,24 @@ pub mod online_deployments { self.skip = Some(skip.into()); self } + #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] + pub fn properties(mut self, properties: impl Into) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "The option to order the response."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } pub fn into_stream( self, - ) -> azure_core::Pageable { + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -22076,7 +14643,7 @@ pub mod online_deployments { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -22090,15 +14657,27 @@ pub mod online_deployments { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } + if let Some(compute_type) = &this.compute_type { + req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(properties) = &this.properties { + req.url_mut().query_pairs_mut().append_pair("properties", properties); + } + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -22117,11 +14696,17 @@ pub mod online_deployments { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -22136,9 +14721,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22183,7 +14768,6 @@ pub mod online_deployments { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22209,18 +14793,25 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -22240,9 +14831,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22302,8 +14893,7 @@ pub mod online_deployments { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::OnlineDeploymentTrackedResource, + pub(crate) body: models::OnlineEndpointTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22330,18 +14920,25 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] #[doc = ""] #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] @@ -22389,9 +14986,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22454,8 +15051,7 @@ pub mod online_deployments { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithSku, + pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22482,18 +15078,25 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] #[doc = ""] #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] @@ -22532,7 +15135,222 @@ pub mod online_deployments { } } } - pub mod delete { + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); + } + Ok(url) + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EndpointAuthKeys = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod regenerate_keys { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22563,11 +15381,6 @@ pub mod online_deployments { } pub struct Headers<'a>(&'a azure_core::headers::Headers); impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } #[doc = "URI to poll for asynchronous operation result."] pub fn location(&self) -> azure_core::Result<&str> { self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) @@ -22601,7 +15414,7 @@ pub mod online_deployments { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, + pub(crate) body: models::RegenerateEndpointKeysRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22613,31 +15426,32 @@ pub mod online_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } - pub mod get_logs { + pub mod get_token { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22646,9 +15460,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentLogs = serde_json::from_slice(&bytes)?; + let body: models::EndpointAuthToken = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22693,8 +15507,6 @@ pub mod online_deployments { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::DeploymentLogsRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22713,26 +15525,26 @@ pub mod online_deployments { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -22743,243 +15555,199 @@ pub mod online_deployments { } } } - pub mod list_skus { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SkuResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() +} +pub mod online_deployments { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List Inference Endpoint Deployments."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + order_by: None, + top: None, + skip: None, } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Get Inference Deployment Deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Number of Skus to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) + #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `body`: Inference Endpoint entity to apply during operation."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), } } - } -} -pub mod schedules { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List schedules in specified workspace."] + #[doc = "Update Online Deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] + pub fn update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), } } - #[doc = "Get schedule."] + #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn get( + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } - #[doc = "Create or update schedule."] + #[doc = "Polls an Endpoint operation."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - #[doc = "* `body`: Schedule definition."] - pub fn create_or_update( + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: The name and identifier for the endpoint."] + #[doc = "* `body`: The request containing parameters for retrieving logs."] + pub fn get_logs( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> get_logs::RequestBuilder { + get_logs::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Delete schedule."] + #[doc = "List Inference Endpoint Deployment Skus."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn delete( + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn list_skus( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> list_skus::RequestBuilder { + list_skus::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + count: None, + skip: None, } } } @@ -22992,9 +15760,9 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23038,21 +15806,30 @@ pub mod schedules { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Top of list."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "Status filter for schedule."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -23073,7 +15850,7 @@ pub mod schedules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -23087,12 +15864,15 @@ pub mod schedules { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -23111,17 +15891,11 @@ pub mod schedules { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -23136,9 +15910,113 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; + let body: models::OnlineDeploymentTrackedResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23147,15 +16025,31 @@ pub mod schedules { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { rsp.into_raw_response() } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) } } #[derive(Clone)] @@ -23164,25 +16058,26 @@ pub mod schedules { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::OnlineDeploymentTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -23194,50 +16089,72 @@ pub mod schedules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod create_or_update { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23246,9 +16163,9 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; + let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23278,10 +16195,13 @@ pub mod schedules { self.0 .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) } } #[derive(Clone)] @@ -23307,8 +16227,9 @@ pub mod schedules { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ScheduleResource, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::PartialMinimalTrackedResourceWithSku, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -23320,7 +16241,7 @@ pub mod schedules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + 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( @@ -23335,25 +16256,18 @@ pub mod schedules { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] #[doc = ""] #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] @@ -23460,7 +16374,8 @@ pub mod schedules { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -23486,53 +16401,123 @@ pub mod schedules { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } -} -pub mod workspace_features { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all enabled features for a workspace"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), + pub mod get_logs { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentLogs = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::DeploymentLogsRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list { + pub mod list_skus { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23541,9 +16526,9 @@ pub mod workspace_features { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ListAmlUserFeatureResult = serde_json::from_slice(&bytes)?; + let body: models::SkuResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23587,9 +16572,23 @@ pub mod workspace_features { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) count: Option, + pub(crate) skip: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Number of Skus to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -23610,7 +16609,7 @@ pub mod workspace_features { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -23624,6 +16623,12 @@ pub mod workspace_features { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -23642,24 +16647,18 @@ pub mod workspace_features { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/features", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } } } -pub mod registries { +pub mod schedules { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23667,241 +16666,94 @@ pub mod registries { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List registries by subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - skip: None, - } - } - #[doc = "List registries"] + #[doc = "List schedules in specified workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), skip: None, + list_view_type: None, } } - #[doc = "Get registry"] + #[doc = "Get schedule."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Schedule name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } - #[doc = "Create or update registry"] + #[doc = "Create or update schedule."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Schedule name."] + #[doc = "* `body`: Schedule definition."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, + workspace_name: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - #[doc = "Update tags"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), body: body.into(), } } - #[doc = "Delete registry."] + #[doc = "Delete schedule."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Schedule name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - registry_name: impl Into, + workspace_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - } - } - } - pub mod list_by_subscription { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-10-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); - } - Ok(url) + workspace_name: workspace_name.into(), + name: name.into(), } } } @@ -23914,9 +16766,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ScheduleResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23959,7 +16811,9 @@ pub mod registries { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { #[doc = "Continuation token for pagination."] @@ -23967,7 +16821,12 @@ pub mod registries { self.skip = Some(skip.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Status filter for schedule."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -23988,7 +16847,7 @@ pub mod registries { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -24005,6 +16864,9 @@ pub mod registries { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -24024,15 +16886,16 @@ pub mod registries { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules", self.client.endpoint(), &self.subscription_id, - &self.resource_group_name + &self.resource_group_name, + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } @@ -24047,9 +16910,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -24092,7 +16955,8 @@ pub mod registries { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -24119,23 +16983,24 @@ pub mod registries { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -24155,9 +17020,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -24166,6 +17031,9 @@ pub mod registries { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -24177,6 +17045,19 @@ pub mod registries { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -24199,8 +17080,9 @@ pub mod registries { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::RegistryTrackedResource, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) body: models::ScheduleResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -24228,24 +17110,25 @@ pub mod registries { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] #[doc = ""] #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] #[doc = ""] @@ -24256,69 +17139,34 @@ pub mod registries { Box::pin(async move { use azure_core::{ error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, sleep::sleep, }; use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; } } - } else { - response.into_body().await } }) } } } - pub mod update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -24327,17 +17175,15 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -24349,31 +17195,46 @@ pub mod registries { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::PartialRegistryPartialTrackedResource, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -24385,15 +17246,14 @@ pub mod registries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -24401,34 +17261,52 @@ pub mod registries { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod workspace_features { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all enabled features for a workspace"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), } } } - pub mod delete { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -24437,6 +17315,11 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListAmlUserFeatureResult = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -24477,43 +17360,73 @@ pub mod registries { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) registry_name: String, + pub(crate) workspace_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2022-10-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()), + ); + 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) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/features", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.registry_name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-01"); } Ok(url) } diff --git a/services/mgmt/machinelearningservices/src/package_preview_2022_12/models.rs b/services/mgmt/machinelearningservices/src/package_2022_10/models.rs similarity index 83% rename from services/mgmt/machinelearningservices/src/package_preview_2022_12/models.rs rename to services/mgmt/machinelearningservices/src/package_2022_10/models.rs index e6d5113706..43f28859e1 100644 --- a/services/mgmt/machinelearningservices/src/package_preview_2022_12/models.rs +++ b/services/mgmt/machinelearningservices/src/package_2022_10/models.rs @@ -163,21 +163,6 @@ pub mod aks_schema { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccessKeyAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl AccessKeyAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} #[doc = "Account key datastore credentials configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccountKeyDatastoreCredentials { @@ -211,19 +196,6 @@ impl AccountKeyDatastoreSecrets { } } } -#[doc = "Details of ACR account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AcrDetails { - #[serde(rename = "systemCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_acr_account: Option, - #[serde(rename = "userCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_acr_account: Option, -} -impl AcrDetails { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Secrets related to a Machine Learning compute based on AKS."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AksComputeSecrets { @@ -279,17 +251,6 @@ impl AksNetworkingConfiguration { Self::default() } } -#[doc = "All nodes means the service will be running on all of the nodes of the job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AllNodes { - #[serde(flatten)] - pub nodes: Nodes, -} -impl AllNodes { - pub fn new(nodes: Nodes) -> Self { - Self { nodes } - } -} #[doc = "An Azure Machine Learning compute."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AmlCompute { @@ -651,7 +612,7 @@ impl AmlComputeSchema { Self::default() } } -#[doc = "Azure Machine Learning REST API operation"] +#[doc = "Azure Machine Learning workspace REST API operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AmlOperation { #[doc = "Operation name: {provider}/{resource}/{operation}"] @@ -696,7 +657,7 @@ pub mod aml_operation { #[doc = "An array of operations supported by the resource provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AmlOperationListResult { - #[doc = "List of AML operations supported by the AML resource provider."] + #[doc = "List of AML workspace operations supported by the AML workspace resource provider."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -744,18 +705,6 @@ impl AmlUserFeature { Self::default() } } -#[doc = "ARM ResourceId of a resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArmResourceId { - #[doc = "Arm ResourceId is in the format \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}\"\r\nor \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}\""] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl ArmResourceId { - pub fn new() -> Self { - Self::default() - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssetBase { #[serde(flatten)] @@ -808,12 +757,6 @@ impl AssetJobInput { #[doc = "Asset output type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssetJobOutput { - #[doc = "Output Asset Name."] - #[serde(rename = "assetName", default, skip_serializing_if = "Option::is_none")] - pub asset_name: Option, - #[doc = "Output Asset Version."] - #[serde(rename = "assetVersion", default, skip_serializing_if = "Option::is_none")] - pub asset_version: Option, #[doc = "Output data delivery mode enums."] #[serde(default, skip_serializing_if = "Option::is_none")] pub mode: Option, @@ -826,51 +769,6 @@ impl AssetJobOutput { Self::default() } } -#[doc = "Provisioning state of registry asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AssetProvisioningState")] -pub enum AssetProvisioningState { - Succeeded, - Failed, - Canceled, - Creating, - Updating, - Deleting, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AssetProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AssetProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AssetProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("AssetProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("AssetProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("AssetProvisioningState", 2u32, "Canceled"), - Self::Creating => serializer.serialize_unit_variant("AssetProvisioningState", 3u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("AssetProvisioningState", 4u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("AssetProvisioningState", 5u32, "Deleting"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Base definition for asset references."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AssetReferenceBase { @@ -1097,23 +995,9 @@ impl AutoTargetRollingWindowSize { } } } -#[doc = "Settings for Autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutologgerSettings { - #[doc = "Enum to determine the state of mlflow autologger."] - #[serde(rename = "mlflowAutologger")] - pub mlflow_autologger: MlFlowAutologgerState, -} -impl AutologgerSettings { - pub fn new(mlflow_autologger: MlFlowAutologgerState) -> Self { - Self { mlflow_autologger } - } -} #[doc = "Azure Blob datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBlobDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "Storage account name."] @@ -1134,7 +1018,6 @@ pub struct AzureBlobDatastore { impl AzureBlobDatastore { pub fn new(datastore: Datastore) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name: None, container_name: None, @@ -1147,8 +1030,6 @@ impl AzureBlobDatastore { #[doc = "Azure Data Lake Gen1 datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureDataLakeGen1Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] @@ -1160,7 +1041,6 @@ pub struct AzureDataLakeGen1Datastore { impl AzureDataLakeGen1Datastore { pub fn new(datastore: Datastore, store_name: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, service_data_access_auth_identity: None, store_name, @@ -1170,8 +1050,6 @@ impl AzureDataLakeGen1Datastore { #[doc = "Azure Data Lake Gen2 datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureDataLakeGen2Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "[Required] Storage account name."] @@ -1191,7 +1069,6 @@ pub struct AzureDataLakeGen2Datastore { impl AzureDataLakeGen2Datastore { pub fn new(datastore: Datastore, account_name: String, filesystem: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name, endpoint: None, @@ -1201,26 +1078,9 @@ impl AzureDataLakeGen2Datastore { } } } -#[doc = "Base definition for Azure datastore contents configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureDatastore { - #[doc = "Azure Resource Group name"] - #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] - pub resource_group: Option, - #[doc = "Azure Subscription Id"] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, -} -impl AzureDatastore { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Azure File datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureFileDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "[Required] Storage account name."] @@ -1241,7 +1101,6 @@ pub struct AzureFileDatastore { impl AzureFileDatastore { pub fn new(datastore: Datastore, account_name: String, file_share_name: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name, endpoint: None, @@ -1554,23 +1413,6 @@ impl BayesianSamplingAlgorithm { Self { sampling_algorithm } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BindOptions { - #[doc = "Type of Bind Option"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub propagation: Option, - #[doc = "Indicate whether to create host path."] - #[serde(rename = "createHostPath", default, skip_serializing_if = "Option::is_none")] - pub create_host_path: Option, - #[doc = "Mention the selinux options."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selinux: Option, -} -impl BindOptions { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Enum for all classification models supported by AutoML."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BlockedTransformers")] @@ -1943,26 +1785,6 @@ impl ClusterUpdateProperties { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CocoExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CocoExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} #[doc = "Configuration for a scoring code asset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CodeConfiguration { @@ -1986,9 +1808,6 @@ impl CodeConfiguration { pub struct CodeContainer { #[serde(flatten)] pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl CodeContainer { pub fn new() -> Self { @@ -2044,9 +1863,6 @@ pub struct CodeVersion { #[doc = "Uri where code is located"] #[serde(rename = "codeUri", default, skip_serializing_if = "Option::is_none")] pub code_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl CodeVersion { pub fn new() -> Self { @@ -2118,9 +1934,6 @@ impl ColumnTransformer { pub struct CommandJob { #[serde(flatten)] pub job_base: JobBase, - #[doc = "Settings for Autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, #[doc = "ARM resource ID of the code asset."] #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] pub code_id: Option, @@ -2154,7 +1967,6 @@ impl CommandJob { pub fn new(job_base: JobBase, command: String, environment_id: String) -> Self { Self { job_base, - autologger_settings: None, code_id: None, command, distribution: None, @@ -2184,9 +1996,6 @@ impl CommandJobLimits { pub struct ComponentContainer { #[serde(flatten)] pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl ComponentContainer { pub fn new() -> Self { @@ -2242,9 +2051,6 @@ pub struct ComponentVersion { #[doc = "Defines Component definition details.\r\n"] #[serde(rename = "componentSpec", default, skip_serializing_if = "Option::is_none")] pub component_spec: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl ComponentVersion { pub fn new() -> Self { @@ -2444,58 +2250,6 @@ impl ComputeInstanceApplication { Self::default() } } -#[doc = "Specifies settings for autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceAutologgerSettings { - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[serde(rename = "mlflowAutologger", default, skip_serializing_if = "Option::is_none")] - pub mlflow_autologger: Option, -} -impl ComputeInstanceAutologgerSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_autologger_settings { - use super::*; - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MlflowAutologger")] - pub enum MlflowAutologger { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MlflowAutologger { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MlflowAutologger { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MlflowAutologger { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlflowAutologger", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlflowAutologger", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ComputeInstanceConnectivityEndpoints { @@ -3091,23 +2845,9 @@ pub struct ComputeInstanceProperties { #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] #[serde(rename = "applicationSharingPolicy", default, skip_serializing_if = "Option::is_none")] pub application_sharing_policy: Option, - #[doc = "Specifies settings for autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, #[doc = "Specifies policy and settings for SSH access."] #[serde(rename = "sshSettings", default, skip_serializing_if = "Option::is_none")] pub ssh_settings: Option, - #[doc = "List of Custom Services added to the compute."] - #[serde( - rename = "customServices", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub custom_services: Vec, - #[doc = "Returns metadata about the operating system image for this compute instance."] - #[serde(rename = "osImageMetadata", default, skip_serializing_if = "Option::is_none")] - pub os_image_metadata: Option, #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] #[serde(rename = "connectivityEndpoints", default, skip_serializing_if = "Option::is_none")] pub connectivity_endpoints: Option, @@ -3146,9 +2886,6 @@ pub struct ComputeInstanceProperties { #[doc = "The list of schedules to be applied on the computes"] #[serde(default, skip_serializing_if = "Option::is_none")] pub schedules: Option, - #[doc = "Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] pub enable_node_public_ip: Option, @@ -3423,7 +3160,7 @@ impl ComputeInstanceVersion { Self::default() } } -#[doc = "[Required] The compute power action."] +#[doc = "The compute power action."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ComputePowerAction")] pub enum ComputePowerAction { @@ -3496,16 +3233,6 @@ impl ComputeResourceSchema { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeRuntimeDto { - #[serde(rename = "sparkRuntimeVersion", default, skip_serializing_if = "Option::is_none")] - pub spark_runtime_version: Option, -} -impl ComputeRuntimeDto { - pub fn new() -> Self { - Self::default() - } -} #[doc = "The list of schedules to be applied on the computes"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ComputeSchedules { @@ -3555,15 +3282,17 @@ pub struct ComputeStartStopSchedule { #[doc = "Is the schedule enabled or disabled?"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, - #[doc = "[Required] The compute power action."] + #[doc = "The compute power action."] #[serde(default, skip_serializing_if = "Option::is_none")] pub action: Option, #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] pub trigger_type: Option, + #[doc = "The workflow trigger recurrence for ComputeStartStop schedule type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub recurrence: Option, + pub recurrence: Option, + #[doc = "The workflow trigger cron for ComputeStartStop schedule type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub cron: Option, + pub cron: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub schedule: Option, } @@ -3680,8 +3409,6 @@ pub enum ConnectionAuthType { None, #[serde(rename = "SAS")] Sas, - ServicePrincipal, - AccessKey, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3712,8 +3439,6 @@ impl Serialize for ConnectionAuthType { Self::UsernamePassword => serializer.serialize_unit_variant("ConnectionAuthType", 2u32, "UsernamePassword"), Self::None => serializer.serialize_unit_variant("ConnectionAuthType", 3u32, "None"), Self::Sas => serializer.serialize_unit_variant("ConnectionAuthType", 4u32, "SAS"), - Self::ServicePrincipal => serializer.serialize_unit_variant("ConnectionAuthType", 5u32, "ServicePrincipal"), - Self::AccessKey => serializer.serialize_unit_variant("ConnectionAuthType", 6u32, "AccessKey"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -3725,15 +3450,6 @@ pub enum ConnectionCategory { PythonFeed, ContainerRegistry, Git, - FeatureStore, - S3, - Snowflake, - AzureSqlDb, - AzureSynapseAnalytics, - AzureMySqlDb, - AzurePostgresDb, - AzureDataLakeGen2, - Redis, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3762,15 +3478,6 @@ impl Serialize for ConnectionCategory { Self::PythonFeed => serializer.serialize_unit_variant("ConnectionCategory", 0u32, "PythonFeed"), Self::ContainerRegistry => serializer.serialize_unit_variant("ConnectionCategory", 1u32, "ContainerRegistry"), Self::Git => serializer.serialize_unit_variant("ConnectionCategory", 2u32, "Git"), - Self::FeatureStore => serializer.serialize_unit_variant("ConnectionCategory", 3u32, "FeatureStore"), - Self::S3 => serializer.serialize_unit_variant("ConnectionCategory", 4u32, "S3"), - Self::Snowflake => serializer.serialize_unit_variant("ConnectionCategory", 5u32, "Snowflake"), - Self::AzureSqlDb => serializer.serialize_unit_variant("ConnectionCategory", 6u32, "AzureSqlDb"), - Self::AzureSynapseAnalytics => serializer.serialize_unit_variant("ConnectionCategory", 7u32, "AzureSynapseAnalytics"), - Self::AzureMySqlDb => serializer.serialize_unit_variant("ConnectionCategory", 8u32, "AzureMySqlDb"), - Self::AzurePostgresDb => serializer.serialize_unit_variant("ConnectionCategory", 9u32, "AzurePostgresDb"), - Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("ConnectionCategory", 10u32, "AzureDataLakeGen2"), - Self::Redis => serializer.serialize_unit_variant("ConnectionCategory", 11u32, "Redis"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -3805,13 +3512,11 @@ impl ContainerResourceSettings { Self::default() } } -#[doc = "The type of container to retrieve logs from."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ContainerType")] pub enum ContainerType { StorageInitializer, InferenceServer, - ModelDataCollector, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3839,7 +3544,6 @@ impl Serialize for ContainerType { match self { Self::StorageInitializer => serializer.serialize_unit_variant("ContainerType", 0u32, "StorageInitializer"), Self::InferenceServer => serializer.serialize_unit_variant("ContainerType", 1u32, "InferenceServer"), - Self::ModelDataCollector => serializer.serialize_unit_variant("ContainerType", 2u32, "ModelDataCollector"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -3864,8 +3568,6 @@ pub enum CredentialsType { None, Sas, ServicePrincipal, - KerberosKeytab, - KerberosPassword, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3896,12 +3598,28 @@ impl Serialize for CredentialsType { Self::None => serializer.serialize_unit_variant("CredentialsType", 2u32, "None"), Self::Sas => serializer.serialize_unit_variant("CredentialsType", 3u32, "Sas"), Self::ServicePrincipal => serializer.serialize_unit_variant("CredentialsType", 4u32, "ServicePrincipal"), - Self::KerberosKeytab => serializer.serialize_unit_variant("CredentialsType", 5u32, "KerberosKeytab"), - Self::KerberosPassword => serializer.serialize_unit_variant("CredentialsType", 6u32, "KerberosPassword"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } +#[doc = "The workflow trigger cron for ComputeStartStop schedule type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cron { + #[doc = "The start time in yyyy-MM-ddTHH:mm:ss format."] + #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] + #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] + pub time_zone: Option, + #[doc = "[Required] Specifies cron expression of schedule.\r\nThe expression should follow NCronTab format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub expression: Option, +} +impl Cron { + pub fn new() -> Self { + Self::default() + } +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CronTrigger { #[serde(flatten)] @@ -3914,26 +3632,6 @@ impl CronTrigger { Self { trigger_base, expression } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CsvExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CsvExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} #[doc = "The desired maximum forecast horizon in units of time-series frequency."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomForecastHorizon { @@ -4005,39 +3703,6 @@ impl CustomSeasonality { Self { seasonality, value } } } -#[doc = "Specifies the custom service configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CustomService { - #[doc = "Name of the Custom Service"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[doc = "Environment Variable for the container"] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub docker: Option, - #[doc = "Configuring the endpoints for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoints: Vec, - #[doc = "Configuring the volumes for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub volumes: Vec, -} -impl CustomService { - pub fn new() -> Self { - Self::default() - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomTargetLags { #[serde(flatten)] @@ -4245,7 +3910,7 @@ pub struct DataVersionBase { #[doc = "Enum to determine the type of data."] #[serde(rename = "dataType")] pub data_type: DataType, - #[doc = "[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330"] + #[doc = "[Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType"] #[serde(rename = "dataUri")] pub data_uri: String, } @@ -4379,22 +4044,6 @@ impl DatabricksSchema { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The unique name of the labeled data asset."] - #[serde(rename = "labeledAssetName", default, skip_serializing_if = "Option::is_none")] - pub labeled_asset_name: Option, -} -impl DatasetExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - labeled_asset_name: None, - } - } -} #[doc = "Base definition for datastore contents configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datastore { @@ -4426,7 +4075,6 @@ pub enum DatastoreUnion { AzureDataLakeGen1(AzureDataLakeGen1Datastore), AzureDataLakeGen2(AzureDataLakeGen2Datastore), AzureFile(AzureFileDatastore), - Hdfs(HdfsDatastore), } #[doc = "Base definition for datastore credentials."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -4445,8 +4093,6 @@ impl DatastoreCredentials { pub enum DatastoreCredentialsUnion { AccountKey(AccountKeyDatastoreCredentials), Certificate(CertificateDatastoreCredentials), - KerberosKeytab(KerberosKeytabCredentials), - KerberosPassword(KerberosPasswordCredentials), None(NoneDatastoreCredentials), Sas(SasDatastoreCredentials), ServicePrincipal(ServicePrincipalDatastoreCredentials), @@ -4509,8 +4155,6 @@ impl DatastoreSecrets { pub enum DatastoreSecretsUnion { AccountKey(AccountKeyDatastoreSecrets), Certificate(CertificateDatastoreSecrets), - KerberosKeytab(KerberosKeytabSecrets), - KerberosPassword(KerberosPasswordSecrets), Sas(SasDatastoreSecrets), ServicePrincipal(ServicePrincipalDatastoreSecrets), } @@ -4522,7 +4166,6 @@ pub enum DatastoreType { AzureDataLakeGen1, AzureDataLakeGen2, AzureFile, - Hdfs, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4552,7 +4195,6 @@ impl Serialize for DatastoreType { Self::AzureDataLakeGen1 => serializer.serialize_unit_variant("DatastoreType", 1u32, "AzureDataLakeGen1"), Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("DatastoreType", 2u32, "AzureDataLakeGen2"), Self::AzureFile => serializer.serialize_unit_variant("DatastoreType", 3u32, "AzureFile"), - Self::Hdfs => serializer.serialize_unit_variant("DatastoreType", 4u32, "Hdfs"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -4580,7 +4222,6 @@ impl DeploymentLogs { } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentLogsRequest { - #[doc = "The type of container to retrieve logs from."] #[serde(rename = "containerType", default, skip_serializing_if = "Option::is_none")] pub container_type: Option, #[doc = "The maximum number of lines to tail."] @@ -4897,17 +4538,6 @@ impl Serialize for DistributionType { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Docker { - #[doc = "Indicate whether container shall run in privileged or non-privileged mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub privileged: Option, -} -impl Docker { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EarlyTerminationPolicy { @@ -5033,17 +4663,6 @@ impl EncryptionKeyVaultProperties { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionKeyVaultUpdateProperties { - #[doc = "Key Vault uri to access the encryption key."] - #[serde(rename = "keyIdentifier")] - pub key_identifier: String, -} -impl EncryptionKeyVaultUpdateProperties { - pub fn new(key_identifier: String) -> Self { - Self { key_identifier } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EncryptionProperty { #[doc = "Indicates whether or not the encryption is enabled for the workspace."] pub status: encryption_property::Status, @@ -5102,120 +4721,37 @@ pub mod encryption_property { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionUpdateProperties { - #[serde(rename = "keyVaultProperties")] - pub key_vault_properties: EncryptionKeyVaultUpdateProperties, -} -impl EncryptionUpdateProperties { - pub fn new(key_vault_properties: EncryptionKeyVaultUpdateProperties) -> Self { - Self { key_vault_properties } - } -} +#[doc = "Keys for endpoint authentication."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Endpoint { - #[doc = "Protocol over which communication will happen over this endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[doc = "Name of the Endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Application port inside the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Port over which the application is exposed from container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub published: Option, - #[doc = "Host IP over which the application is exposed from the container"] - #[serde(rename = "hostIp", default, skip_serializing_if = "Option::is_none")] - pub host_ip: Option, +pub struct EndpointAuthKeys { + #[doc = "The primary key."] + #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] + pub primary_key: Option, + #[doc = "The secondary key."] + #[serde(rename = "secondaryKey", default, skip_serializing_if = "Option::is_none")] + pub secondary_key: Option, } -impl Endpoint { +impl EndpointAuthKeys { pub fn new() -> Self { Self::default() } } -pub mod endpoint { - use super::*; - #[doc = "Protocol over which communication will happen over this endpoint"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Protocol")] - pub enum Protocol { - #[serde(rename = "tcp")] - Tcp, - #[serde(rename = "udp")] - Udp, - #[serde(rename = "http")] - Http, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Protocol { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Protocol { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Protocol { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "tcp"), - Self::Udp => serializer.serialize_unit_variant("Protocol", 1u32, "udp"), - Self::Http => serializer.serialize_unit_variant("Protocol", 2u32, "http"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Protocol { - fn default() -> Self { - Self::Tcp - } - } -} -#[doc = "Keys for endpoint authentication."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EndpointAuthKeys { - #[doc = "The primary key."] - #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] - pub primary_key: Option, - #[doc = "The secondary key."] - #[serde(rename = "secondaryKey", default, skip_serializing_if = "Option::is_none")] - pub secondary_key: Option, -} -impl EndpointAuthKeys { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to determine endpoint authentication mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointAuthMode")] -pub enum EndpointAuthMode { - #[serde(rename = "AMLToken")] - AmlToken, - Key, - #[serde(rename = "AADToken")] - AadToken, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointAuthMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) +#[doc = "Enum to determine endpoint authentication mode."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "EndpointAuthMode")] +pub enum EndpointAuthMode { + #[serde(rename = "AMLToken")] + AmlToken, + Key, + #[serde(rename = "AADToken")] + AadToken, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for EndpointAuthMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) } } impl<'de> Deserialize<'de> for EndpointAuthMode { @@ -5311,7 +4847,7 @@ pub struct EndpointDeploymentPropertiesBase { #[doc = "Description of the endpoint deployment."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, - #[doc = "ARM resource ID of the environment specification for the endpoint deployment."] + #[doc = "ARM resource ID or AssetId of the environment specification for the endpoint deployment."] #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] pub environment_id: Option, #[doc = "Environment variables configuration for the deployment."] @@ -5426,9 +4962,6 @@ impl EndpointScheduleAction { pub struct EnvironmentContainer { #[serde(flatten)] pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl EnvironmentContainer { pub fn new() -> Self { @@ -5513,64 +5046,6 @@ impl Serialize for EnvironmentType { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVariable { - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Value of the Environment variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl EnvironmentVariable { - pub fn new() -> Self { - Self::default() - } -} -pub mod environment_variable { - use super::*; - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "local")] - Local, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Local => serializer.serialize_unit_variant("Type", 0u32, "local"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Local - } - } -} #[doc = "Environment version details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentVersion { @@ -5596,9 +5071,6 @@ pub struct EnvironmentVersion { #[doc = "The type of operating system."] #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] pub os_type: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl EnvironmentVersion { pub fn new() -> Self { @@ -5912,82 +5384,6 @@ pub mod estimated_vm_prices { } } } -#[doc = "The format of exported labels."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ExportFormatType")] -pub enum ExportFormatType { - Dataset, - Coco, - #[serde(rename = "CSV")] - Csv, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ExportFormatType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ExportFormatType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ExportFormatType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dataset => serializer.serialize_unit_variant("ExportFormatType", 0u32, "Dataset"), - Self::Coco => serializer.serialize_unit_variant("ExportFormatType", 1u32, "Coco"), - Self::Csv => serializer.serialize_unit_variant("ExportFormatType", 2u32, "CSV"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportSummary { - #[doc = "The time when the export was completed."] - #[serde(rename = "endDateTime", default, with = "azure_core::date::rfc3339::option")] - pub end_date_time: Option, - #[doc = "The total number of labeled datapoints exported."] - #[serde(rename = "exportedRowCount", default, skip_serializing_if = "Option::is_none")] - pub exported_row_count: Option, - #[doc = "The format of exported labels."] - pub format: ExportFormatType, - #[doc = "Name and identifier of the job containing exported labels."] - #[serde(rename = "labelingJobId", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_id: Option, - #[doc = "The time when the export was requested."] - #[serde(rename = "startDateTime", default, with = "azure_core::date::rfc3339::option")] - pub start_date_time: Option, -} -impl ExportSummary { - pub fn new(format: ExportFormatType) -> Self { - Self { - end_date_time: None, - exported_row_count: None, - format, - labeling_job_id: None, - start_date_time: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "format")] -pub enum ExportSummaryUnion { - Coco(CocoExportSummary), - #[serde(rename = "CSV")] - Csv(CsvExportSummary), - Dataset(DatasetExportSummary), -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalFqdnResponse { #[serde( @@ -6092,26 +5488,6 @@ impl Serialize for FeatureLags { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureStoreSettings { - #[serde(rename = "computeRuntime", default, skip_serializing_if = "Option::is_none")] - pub compute_runtime: Option, - #[serde(rename = "offlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub offline_store_connection_name: Option, - #[serde(rename = "onlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub online_store_connection_name: Option, - #[serde( - rename = "allowRoleAssignmentsOnResourceGroupLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_role_assignments_on_resource_group_level: Option, -} -impl FeatureStoreSettings { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Featurization mode - determines data featurization mode."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "FeaturizationMode")] @@ -6550,30 +5926,6 @@ impl HdInsightSchema { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdfsDatastore { - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if \"Https\" protocol is selected."] - #[serde(rename = "hdfsServerCertificate", default, skip_serializing_if = "Option::is_none")] - pub hdfs_server_certificate: Option, - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "nameNodeAddress")] - pub name_node_address: String, - #[doc = "Protocol used to communicate with the storage account (Https/Http)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, -} -impl HdfsDatastore { - pub fn new(datastore: Datastore, name_node_address: String) -> Self { - Self { - datastore, - hdfs_server_certificate: None, - name_node_address, - protocol: None, - } - } -} #[doc = "Reference to an asset via its ARM resource ID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdAssetReference { @@ -6663,118 +6015,6 @@ impl IdentityForCmk { Self::default() } } -#[doc = "Stops compute instance after user defined period of inactivity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdleShutdownSetting { - #[doc = "Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, -} -impl IdleShutdownSetting { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Image { - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Image reference URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reference: Option, -} -impl Image { - pub fn new() -> Self { - Self::default() - } -} -pub mod image { - use super::*; - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "docker")] - Docker, - #[serde(rename = "azureml")] - Azureml, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Docker => serializer.serialize_unit_variant("Type", 0u32, "docker"), - Self::Azureml => serializer.serialize_unit_variant("Type", 1u32, "azureml"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Docker - } - } -} -#[doc = "Annotation type of image data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImageAnnotationType")] -pub enum ImageAnnotationType { - Classification, - BoundingBox, - InstanceSegmentation, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ImageAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ImageAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ImageAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("ImageAnnotationType", 0u32, "Classification"), - Self::BoundingBox => serializer.serialize_unit_variant("ImageAnnotationType", 1u32, "BoundingBox"), - Self::InstanceSegmentation => serializer.serialize_unit_variant("ImageAnnotationType", 2u32, "InstanceSegmentation"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Image Classification. Multi-class image classification is used when an image is classified with only a single label\r\nfrom a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageClassification { @@ -6878,24 +6118,6 @@ impl ImageLimitSettings { Self::default() } } -#[doc = "Returns metadata about the operating system image for this compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageMetadata { - #[doc = "Specifies the current operating system image version this compute instance is running on."] - #[serde(rename = "currentImageVersion", default, skip_serializing_if = "Option::is_none")] - pub current_image_version: Option, - #[doc = "Specifies the latest available operating system image version."] - #[serde(rename = "latestImageVersion", default, skip_serializing_if = "Option::is_none")] - pub latest_image_version: Option, - #[doc = "Specifies whether this compute instance is running on the latest operating system image."] - #[serde(rename = "isLatestOsImageVersion", default, skip_serializing_if = "Option::is_none")] - pub is_latest_os_image_version: Option, -} -impl ImageMetadata { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageModelDistributionSettings { @@ -7326,51 +6548,14 @@ impl ImageVertical { } } } -#[doc = "Whether IncrementalDataRefresh is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IncrementalDataRefresh")] -pub enum IncrementalDataRefresh { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for IncrementalDataRefresh { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for IncrementalDataRefresh { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for IncrementalDataRefresh { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InferenceContainerProperties { - #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] - pub liveness_route: Option, - #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] - pub readiness_route: Option, - #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] - pub scoring_route: Option, +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InferenceContainerProperties { + #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] + pub liveness_route: Option, + #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] + pub readiness_route: Option, + #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] + pub scoring_route: Option, } impl InferenceContainerProperties { pub fn new() -> Self { @@ -7555,9 +6740,7 @@ pub enum JobBaseUnion { #[serde(rename = "AutoML")] AutoMl(AutoMlJob), Command(CommandJob), - Labeling(LabelingJob), Pipeline(PipelineJob), - Spark(SparkJob), Sweep(SweepJob), } #[doc = "Azure Resource Manager resource envelope."] @@ -7834,47 +7017,6 @@ impl Serialize for JobOutputType { } } } -#[doc = "Enum to determine the job provisioning state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobProvisioningState")] -pub enum JobProvisioningState { - Succeeded, - Failed, - Canceled, - InProgress, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("JobProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("JobProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobProvisioningState", 2u32, "Canceled"), - Self::InProgress => serializer.serialize_unit_variant("JobProvisioningState", 3u32, "InProgress"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobResourceConfiguration { #[serde(flatten)] @@ -7919,10 +7061,7 @@ pub struct JobService { #[doc = "Endpoint type."] #[serde(rename = "jobServiceType", default, skip_serializing_if = "Option::is_none")] pub job_service_type: Option, - #[doc = "Abstract Nodes definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nodes: Option, - #[doc = "Port for endpoint set by user."] + #[doc = "Port for endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] pub port: Option, #[doc = "Additional properties to set on the endpoint."] @@ -7955,7 +7094,6 @@ pub enum JobStatus { NotResponding, Paused, Unknown, - Scheduled, #[serde(skip_deserializing)] UnknownValue(String), } @@ -7995,7 +7133,6 @@ impl Serialize for JobStatus { Self::NotResponding => serializer.serialize_unit_variant("JobStatus", 11u32, "NotResponding"), Self::Paused => serializer.serialize_unit_variant("JobStatus", 12u32, "Paused"), Self::Unknown => serializer.serialize_unit_variant("JobStatus", 13u32, "Unknown"), - Self::Scheduled => serializer.serialize_unit_variant("JobStatus", 14u32, "Scheduled"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -8007,10 +7144,8 @@ pub enum JobType { #[serde(rename = "AutoML")] AutoMl, Command, - Labeling, Sweep, Pipeline, - Spark, #[serde(skip_deserializing)] UnknownValue(String), } @@ -8038,110 +7173,13 @@ impl Serialize for JobType { match self { Self::AutoMl => serializer.serialize_unit_variant("JobType", 0u32, "AutoML"), Self::Command => serializer.serialize_unit_variant("JobType", 1u32, "Command"), - Self::Labeling => serializer.serialize_unit_variant("JobType", 2u32, "Labeling"), - Self::Sweep => serializer.serialize_unit_variant("JobType", 3u32, "Sweep"), - Self::Pipeline => serializer.serialize_unit_variant("JobType", 4u32, "Pipeline"), - Self::Spark => serializer.serialize_unit_variant("JobType", 5u32, "Spark"), + Self::Sweep => serializer.serialize_unit_variant("JobType", 2u32, "Sweep"), + Self::Pipeline => serializer.serialize_unit_variant("JobType", 3u32, "Pipeline"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosCredentials { - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "kerberosKdcAddress")] - pub kerberos_kdc_address: String, - #[doc = "[Required] Kerberos Username"] - #[serde(rename = "kerberosPrincipal")] - pub kerberos_principal: String, - #[doc = "[Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service."] - #[serde(rename = "kerberosRealm")] - pub kerberos_realm: String, -} -impl KerberosCredentials { - pub fn new(kerberos_kdc_address: String, kerberos_principal: String, kerberos_realm: String) -> Self { - Self { - kerberos_kdc_address, - kerberos_principal, - kerberos_realm, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosKeytabSecrets, -} -impl KerberosKeytabCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosKeytabSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos keytab secret."] - #[serde(rename = "kerberosKeytab", default, skip_serializing_if = "Option::is_none")] - pub kerberos_keytab: Option, -} -impl KerberosKeytabSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_keytab: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosPasswordSecrets, -} -impl KerberosPasswordCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosPasswordSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos password secret."] - #[serde(rename = "kerberosPassword", default, skip_serializing_if = "Option::is_none")] - pub kerberos_password: Option, -} -impl KerberosPasswordSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_password: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "KeyType")] pub enum KeyType { Primary, @@ -8255,217 +7293,6 @@ impl KubernetesSchema { Self::default() } } -#[doc = "Label category definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelCategory { - #[doc = "Dictionary of label classes in this category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub classes: Option, - #[doc = "Display name of the label category."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Whether multiSelect is enabled"] - #[serde(rename = "multiSelect", default, skip_serializing_if = "Option::is_none")] - pub multi_select: Option, -} -impl LabelCategory { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label class definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelClass { - #[doc = "Display name of the label class."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Dictionary of subclasses of the label class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subclasses: Option, -} -impl LabelClass { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling data configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingDataConfiguration { - #[doc = "Resource Id of the data asset to perform labeling."] - #[serde(rename = "dataId", default, skip_serializing_if = "Option::is_none")] - pub data_id: Option, - #[doc = "Whether IncrementalDataRefresh is enabled"] - #[serde(rename = "incrementalDataRefresh", default, skip_serializing_if = "Option::is_none")] - pub incremental_data_refresh: Option, -} -impl LabelingDataConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling job definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Created time of the job in UTC timezone."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[doc = "Labeling data configuration definition"] - #[serde(rename = "dataConfiguration", default, skip_serializing_if = "Option::is_none")] - pub data_configuration: Option, - #[doc = "Instructions for labeling job"] - #[serde(rename = "jobInstructions", default, skip_serializing_if = "Option::is_none")] - pub job_instructions: Option, - #[doc = "Label categories of the job."] - #[serde(rename = "labelCategories", default, skip_serializing_if = "Option::is_none")] - pub label_categories: Option, - #[doc = "Properties of a labeling job"] - #[serde(rename = "labelingJobMediaProperties", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_media_properties: Option, - #[doc = "Labeling MLAssist configuration definition"] - #[serde(rename = "mlAssistConfiguration", default, skip_serializing_if = "Option::is_none")] - pub ml_assist_configuration: Option, - #[doc = "Progress metrics definition"] - #[serde(rename = "progressMetrics", default, skip_serializing_if = "Option::is_none")] - pub progress_metrics: Option, - #[doc = "Internal id of the job(Previously called project)."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option, - #[doc = "Enum to determine the job provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Status messages of the job."] - #[serde( - rename = "statusMessages", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub status_messages: Vec, -} -impl LabelingJob { - pub fn new(job_base: JobBase) -> Self { - Self { - job_base, - created_date_time: None, - data_configuration: None, - job_instructions: None, - label_categories: None, - labeling_job_media_properties: None, - ml_assist_configuration: None, - progress_metrics: None, - project_id: None, - provisioning_state: None, - status_messages: Vec::new(), - } - } -} -#[doc = "Properties of a labeling job for image data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobImageProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of image data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobImageProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[doc = "Instructions for labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobInstructions { - #[doc = "The link to a page with detailed labeling instructions for labelers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, -} -impl LabelingJobInstructions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobMediaProperties { - #[doc = "Media type of data asset."] - #[serde(rename = "mediaType")] - pub media_type: MediaType, -} -impl LabelingJobMediaProperties { - pub fn new(media_type: MediaType) -> Self { - Self { media_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mediaType")] -pub enum LabelingJobMediaPropertiesUnion { - Image(LabelingJobImageProperties), - Text(LabelingJobTextProperties), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Labeling job definition"] - pub properties: LabelingJob, -} -impl LabelingJobResource { - pub fn new(properties: LabelingJob) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of LabelingJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobResourceArmPaginatedResult { - #[doc = "The link to the next page of LabelingJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type LabelingJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for LabelingJobResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl LabelingJobResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job for text data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobTextProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of text data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobTextProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} #[doc = "Learning rate scheduler enum."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "LearningRateScheduler")] @@ -8716,132 +7543,6 @@ impl Serialize for LogVerbosity { } } } -#[doc = "Labeling MLAssist configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfiguration { - #[serde(rename = "mlAssist")] - pub ml_assist: MlAssistConfigurationType, -} -impl MlAssistConfiguration { - pub fn new(ml_assist: MlAssistConfigurationType) -> Self { - Self { ml_assist } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mlAssist")] -pub enum MlAssistConfigurationUnion { - Disabled(MlAssistConfigurationDisabled), - Enabled(MlAssistConfigurationEnabled), -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is disabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationDisabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, -} -impl MlAssistConfigurationDisabled { - pub fn new(ml_assist_configuration: MlAssistConfiguration) -> Self { - Self { ml_assist_configuration } - } -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationEnabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, - #[doc = "[Required] AML compute binding used in inferencing."] - #[serde(rename = "inferencingComputeBinding")] - pub inferencing_compute_binding: String, - #[doc = "[Required] AML compute binding used in training."] - #[serde(rename = "trainingComputeBinding")] - pub training_compute_binding: String, -} -impl MlAssistConfigurationEnabled { - pub fn new( - ml_assist_configuration: MlAssistConfiguration, - inferencing_compute_binding: String, - training_compute_binding: String, - ) -> Self { - Self { - ml_assist_configuration, - inferencing_compute_binding, - training_compute_binding, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlAssistConfigurationType")] -pub enum MlAssistConfigurationType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlAssistConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlAssistConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlAssistConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the state of mlflow autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlFlowAutologgerState")] -pub enum MlFlowAutologgerState { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlFlowAutologgerState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlFlowAutologgerState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlFlowAutologgerState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MlFlowModelJobInput { #[serde(flatten)] @@ -9045,43 +7746,6 @@ impl Serialize for ManagedServiceIdentityType { } } } -#[doc = "Media type of data asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MediaType")] -pub enum MediaType { - Image, - Text, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MediaType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MediaType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MediaType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Image => serializer.serialize_unit_variant("MediaType", 0u32, "Image"), - Self::Text => serializer.serialize_unit_variant("MediaType", 1u32, "Text"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Defines an early termination policy based on running averages of the primary metric of all runs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MedianStoppingPolicy { @@ -9097,9 +7761,6 @@ impl MedianStoppingPolicy { pub struct ModelContainer { #[serde(flatten)] pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl ModelContainer { pub fn new() -> Self { @@ -9206,9 +7867,6 @@ pub struct ModelVersion { #[doc = "The URI path to the model contents."] #[serde(rename = "modelUri", default, skip_serializing_if = "Option::is_none")] pub model_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, } impl ModelVersion { pub fn new() -> Self { @@ -9273,43 +7931,6 @@ impl Mpi { } } } -#[doc = "Whether multiSelect is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MultiSelect")] -pub enum MultiSelect { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MultiSelect { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MultiSelect { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MultiSelect { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MultiSelect", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MultiSelect", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "N-Cross validations value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct NCrossValidations { @@ -9364,164 +7985,14 @@ impl Serialize for NCrossValidationsMode { } } } -#[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpFixedParameters { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NlpLearningRateScheduler")] -pub enum NlpLearningRateScheduler { - None, - Linear, - Cosine, - CosineWithRestarts, - Polynomial, - Constant, - ConstantWithWarmup, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NlpLearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NlpLearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NlpLearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("NlpLearningRateScheduler", 0u32, "None"), - Self::Linear => serializer.serialize_unit_variant("NlpLearningRateScheduler", 1u32, "Linear"), - Self::Cosine => serializer.serialize_unit_variant("NlpLearningRateScheduler", 2u32, "Cosine"), - Self::CosineWithRestarts => serializer.serialize_unit_variant("NlpLearningRateScheduler", 3u32, "CosineWithRestarts"), - Self::Polynomial => serializer.serialize_unit_variant("NlpLearningRateScheduler", 4u32, "Polynomial"), - Self::Constant => serializer.serialize_unit_variant("NlpLearningRateScheduler", 5u32, "Constant"), - Self::ConstantWithWarmup => serializer.serialize_unit_variant("NlpLearningRateScheduler", 6u32, "ConstantWithWarmup"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stringified search spaces for each parameter. See below examples."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpParameterSubspace { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "The type of learning rate schedule to use during the training procedure."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model sweeping and hyperparameter tuning related settings."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NlpSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl NlpSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} #[doc = "Abstract class for NLP related AutoML tasks.\r\nNLP - Natural Language Processing."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NlpVertical { #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, #[doc = "Job execution constraints."] #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] pub limit_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[doc = "Model sweeping and hyperparameter tuning related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] pub validation_data: Option, } @@ -9546,18 +8017,12 @@ pub struct NlpVerticalLimitSettings { #[doc = "Maximum Concurrent AutoML iterations."] #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] pub max_concurrent_trials: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, #[doc = "Number of AutoML iterations."] #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] pub max_trials: Option, #[doc = "AutoML job timeout."] #[serde(default, skip_serializing_if = "Option::is_none")] pub timeout: Option, - #[doc = "Timeout for individual HD trials."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, } impl NlpVerticalLimitSettings { pub fn new() -> Self { @@ -9580,69 +8045,15 @@ pub struct NodeStateCounts { #[serde(rename = "unusableNodeCount", default, skip_serializing_if = "Option::is_none")] pub unusable_node_count: Option, #[doc = "Number of compute nodes which are leaving the amlCompute."] - #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] - pub leaving_node_count: Option, - #[doc = "Number of compute nodes which are in preempted state."] - #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] - pub preempted_node_count: Option, -} -impl NodeStateCounts { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Abstract Nodes definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Nodes { - #[doc = "The enumerated types for the nodes value"] - #[serde(rename = "nodesValueType")] - pub nodes_value_type: NodesValueType, -} -impl Nodes { - pub fn new(nodes_value_type: NodesValueType) -> Self { - Self { nodes_value_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "nodesValueType")] -pub enum NodesUnion { - All(AllNodes), -} -#[doc = "The enumerated types for the nodes value"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NodesValueType")] -pub enum NodesValueType { - All, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NodesValueType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NodesValueType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NodesValueType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::All => serializer.serialize_unit_variant("NodesValueType", 0u32, "All"), - Self::Custom => serializer.serialize_unit_variant("NodesValueType", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } + #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] + pub leaving_node_count: Option, + #[doc = "Number of compute nodes which are in preempted state."] + #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] + pub preempted_node_count: Option, +} +impl NodeStateCounts { + pub fn new() -> Self { + Self::default() } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -9889,9 +8300,6 @@ pub struct OnlineEndpoint { #[doc = "ARM resource ID of the compute if it exists.\r\noptional"] #[serde(default, skip_serializing_if = "Option::is_none")] pub compute: Option, - #[doc = "Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50."] - #[serde(rename = "mirrorTraffic", default, skip_serializing_if = "Option::is_none")] - pub mirror_traffic: Option, #[doc = "State of endpoint provisioning."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -9907,7 +8315,6 @@ impl OnlineEndpoint { Self { endpoint_properties_base, compute: None, - mirror_traffic: None, provisioning_state: None, public_network_access: None, traffic: None, @@ -10084,7 +8491,6 @@ impl Serialize for OrderString { pub enum OutputDeliveryMode { ReadWriteMount, Upload, - Direct, #[serde(skip_deserializing)] UnknownValue(String), } @@ -10112,7 +8518,6 @@ impl Serialize for OutputDeliveryMode { match self { Self::ReadWriteMount => serializer.serialize_unit_variant("OutputDeliveryMode", 0u32, "ReadWriteMount"), Self::Upload => serializer.serialize_unit_variant("OutputDeliveryMode", 1u32, "Upload"), - Self::Direct => serializer.serialize_unit_variant("OutputDeliveryMode", 2u32, "Direct"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -10260,38 +8665,6 @@ impl PartialMinimalTrackedResourceWithSku { Self::default() } } -#[doc = "Partial Registry class for PATCH"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistry {} -impl PartialRegistry { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistryPartialTrackedResource { - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Partial Registry class for PATCH"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Common SKU definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialRegistryPartialTrackedResource { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Common SKU definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PartialSku { @@ -10661,27 +9034,6 @@ impl ProbeSettings { Self::default() } } -#[doc = "Progress metrics definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProgressMetrics { - #[doc = "The completed datapoint count."] - #[serde(rename = "completedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub completed_datapoint_count: Option, - #[doc = "The time of last successful incremental data refresh in UTC."] - #[serde(rename = "incrementalDataLastRefreshDateTime", default, with = "azure_core::date::rfc3339::option")] - pub incremental_data_last_refresh_date_time: Option, - #[doc = "The skipped datapoint count."] - #[serde(rename = "skippedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub skipped_datapoint_count: Option, - #[doc = "The total datapoint count."] - #[serde(rename = "totalDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub total_datapoint_count: Option, -} -impl ProgressMetrics { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PublicNetworkAccessType")] @@ -10819,9 +9171,6 @@ impl QuotaUpdateParameters { pub struct RandomSamplingAlgorithm { #[serde(flatten)] pub sampling_algorithm: SamplingAlgorithm, - #[doc = "An optional positive number or e in string format to be used as base for log based random sampling"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub logbase: Option, #[doc = "The specific type of random algorithm"] #[serde(default, skip_serializing_if = "Option::is_none")] pub rule: Option, @@ -10833,7 +9182,6 @@ impl RandomSamplingAlgorithm { pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { Self { sampling_algorithm, - logbase: None, rule: None, seed: None, } @@ -10876,6 +9224,29 @@ impl Serialize for RandomSamplingAlgorithmRule { } } } +#[doc = "The workflow trigger recurrence for ComputeStartStop schedule type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Recurrence { + #[doc = "Enum to describe the frequency of a recurrence schedule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub frequency: Option, + #[doc = "[Required] Specifies schedule interval in conjunction with frequency"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub interval: Option, + #[doc = "The start time in yyyy-MM-ddTHH:mm:ss format."] + #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] + #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] + pub time_zone: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub schedule: Option, +} +impl Recurrence { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Enum to describe the frequency of a recurrence schedule"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "RecurrenceFrequency")] @@ -11025,38 +9396,6 @@ impl RegenerateEndpointKeysRequest { Self { key_type, key_value: None } } } -#[doc = "Details of the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Registry { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] - pub discovery_url: Option, - #[serde(rename = "intellectualPropertyPublisher", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property_publisher: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "managedResourceGroup", default, skip_serializing_if = "Option::is_none")] - pub managed_resource_group: Option, - #[serde(rename = "mlFlowRegistryUri", default, skip_serializing_if = "Option::is_none")] - pub ml_flow_registry_uri: Option, - #[serde(rename = "privateLinkCount", default, skip_serializing_if = "Option::is_none")] - pub private_link_count: Option, - #[doc = "Details of each region the registry is in"] - #[serde( - rename = "regionDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub region_details: Vec, -} -impl Registry { - pub fn new() -> Self { - Self::default() - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RegistryListCredentialsResult { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11075,86 +9414,6 @@ impl RegistryListCredentialsResult { Self::default() } } -#[doc = "Details for each region the registry is in"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryRegionArmDetails { - #[doc = "List of ACR accounts"] - #[serde( - rename = "acrDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub acr_details: Vec, - #[doc = "The location where the registry exists"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "List of storage accounts"] - #[serde( - rename = "storageAccountDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub storage_account_details: Vec, -} -impl RegistryRegionArmDetails { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegistryTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Details of the Registry"] - pub properties: Registry, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl RegistryTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: Registry) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of Registry entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of Registry objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Registry."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for RegistryTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl RegistryTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Regression task in AutoML Table vertical."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Regression { @@ -11939,7 +10198,7 @@ impl Serialize for ScheduleStatus { #[doc = "Script reference"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScriptReference { - #[doc = "The storage source of the script: inline, workspace."] + #[doc = "The storage source of the script: workspace."] #[serde(rename = "scriptSource", default, skip_serializing_if = "Option::is_none")] pub script_source: Option, #[doc = "The location of scripts in the mounted volume."] @@ -12034,8 +10293,6 @@ pub enum SecretsType { Certificate, Sas, ServicePrincipal, - KerberosPassword, - KerberosKeytab, #[serde(skip_deserializing)] UnknownValue(String), } @@ -12065,8 +10322,6 @@ impl Serialize for SecretsType { Self::Certificate => serializer.serialize_unit_variant("SecretsType", 1u32, "Certificate"), Self::Sas => serializer.serialize_unit_variant("SecretsType", 2u32, "Sas"), Self::ServicePrincipal => serializer.serialize_unit_variant("SecretsType", 3u32, "ServicePrincipal"), - Self::KerberosPassword => serializer.serialize_unit_variant("SecretsType", 4u32, "KerberosPassword"), - Self::KerberosKeytab => serializer.serialize_unit_variant("SecretsType", 5u32, "KerberosKeytab"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -12123,21 +10378,6 @@ impl ServiceManagedResourcesSettings { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ServicePrincipalAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} #[doc = "Service Principal datastore credentials configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServicePrincipalDatastoreCredentials { @@ -12416,195 +10656,24 @@ impl Serialize for SkuScaleType { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SkuSetting { #[doc = "[Required] The name of the SKU. Ex - P3. It is typically a letter+number code."] - pub name: String, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, -} -impl SkuSetting { - pub fn new(name: String) -> Self { - Self { name, tier: None } - } -} -#[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum SkuTier { - Free, - Basic, - Standard, - Premium, -} -#[doc = "Spark job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Archive files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub archives: Vec, - #[doc = "Arguments for the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub args: Option, - #[doc = "[Required] ARM resource ID of the code asset."] - #[serde(rename = "codeId")] - pub code_id: String, - #[doc = "Spark configured properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub conf: Option, - #[doc = "Spark job entry point definition."] - pub entry: SparkJobEntryUnion, - #[doc = "The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub files: Vec, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jar files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub jars: Vec, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Python files used in the job."] - #[serde( - rename = "pyFiles", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub py_files: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl SparkJob { - pub fn new(job_base: JobBase, code_id: String, entry: SparkJobEntryUnion) -> Self { - Self { - job_base, - archives: Vec::new(), - args: None, - code_id, - conf: None, - entry, - environment_id: None, - files: Vec::new(), - inputs: None, - jars: Vec::new(), - outputs: None, - py_files: Vec::new(), - resources: None, - } - } -} -#[doc = "Spark job entry point definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobEntry { - #[serde(rename = "sparkJobEntryType")] - pub spark_job_entry_type: SparkJobEntryType, -} -impl SparkJobEntry { - pub fn new(spark_job_entry_type: SparkJobEntryType) -> Self { - Self { spark_job_entry_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "sparkJobEntryType")] -pub enum SparkJobEntryUnion { - SparkJobPythonEntry(SparkJobPythonEntry), - SparkJobScalaEntry(SparkJobScalaEntry), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SparkJobEntryType")] -pub enum SparkJobEntryType { - SparkJobPythonEntry, - SparkJobScalaEntry, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SparkJobEntryType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SparkJobEntryType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SparkJobEntryType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SparkJobPythonEntry => serializer.serialize_unit_variant("SparkJobEntryType", 0u32, "SparkJobPythonEntry"), - Self::SparkJobScalaEntry => serializer.serialize_unit_variant("SparkJobEntryType", 1u32, "SparkJobScalaEntry"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobPythonEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Relative python file path for job entry point."] - pub file: String, -} -impl SparkJobPythonEntry { - pub fn new(spark_job_entry: SparkJobEntry, file: String) -> Self { - Self { spark_job_entry, file } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobScalaEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Scala class name used as entry point."] - #[serde(rename = "className")] - pub class_name: String, -} -impl SparkJobScalaEntry { - pub fn new(spark_job_entry: SparkJobEntry, class_name: String) -> Self { - Self { - spark_job_entry, - class_name, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SparkResourceConfiguration { - #[doc = "Optional type of VM used as supported by the compute target."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Version of spark runtime used for the job."] - #[serde(rename = "runtimeVersion", default, skip_serializing_if = "Option::is_none")] - pub runtime_version: Option, + pub name: String, + #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, } -impl SparkResourceConfiguration { - pub fn new() -> Self { - Self::default() +impl SkuSetting { + pub fn new(name: String) -> Self { + Self { name, tier: None } } } +#[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum SkuTier { + Free, + Basic, + Standard, + Premium, +} #[doc = "The ssl configuration for scoring"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SslConfiguration { @@ -12745,64 +10814,6 @@ impl Serialize for StackMetaLearnerType { } } } -#[doc = "Active message associated with project"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StatusMessage { - #[doc = "Service-defined message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Time in UTC at which the message was created."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "A human-readable representation of the message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl StatusMessage { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StatusMessageLevel")] -pub enum StatusMessageLevel { - Error, - Information, - Warning, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StatusMessageLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StatusMessageLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StatusMessageLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Error => serializer.serialize_unit_variant("StatusMessageLevel", 0u32, "Error"), - Self::Information => serializer.serialize_unit_variant("StatusMessageLevel", 1u32, "Information"), - Self::Warning => serializer.serialize_unit_variant("StatusMessageLevel", 2u32, "Warning"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Stochastic optimizer for image models."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "StochasticOptimizer")] @@ -12844,19 +10855,6 @@ impl Serialize for StochasticOptimizer { } } } -#[doc = "Details of storage account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StorageAccountDetails { - #[serde(rename = "systemCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_storage_account: Option, - #[serde(rename = "userCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_storage_account: Option, -} -impl StorageAccountDetails { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Sweep job definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SweepJob { @@ -12985,37 +10983,6 @@ pub mod synapse_spark { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedAcrAccount { - #[serde(rename = "acrAccountSku", default, skip_serializing_if = "Option::is_none")] - pub acr_account_sku: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl SystemCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedStorageAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, - #[serde(rename = "storageAccountHnsEnabled", default, skip_serializing_if = "Option::is_none")] - pub storage_account_hns_enabled: Option, - #[doc = "Allowed values:\r\n\"Standard_LRS\",\r\n\"Standard_GRS\",\r\n\"Standard_RAGRS\",\r\n\"Standard_ZRS\",\r\n\"Standard_GZRS\",\r\n\"Standard_RAGZRS\",\r\n\"Premium_LRS\",\r\n\"Premium_ZRS\""] - #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] - pub storage_account_type: Option, - #[serde(rename = "allowBlobPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub allow_blob_public_access: Option, -} -impl SystemCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} #[doc = "A system service running on a compute."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SystemService { @@ -13034,159 +11001,6 @@ impl SystemService { Self::default() } } -#[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableFixedParameters { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample."] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableParameterSubspace { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample"] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TableSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl TableSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} #[doc = "Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TableVertical { @@ -13201,25 +11015,12 @@ pub struct TableVertical { #[doc = "Featurization Configuration."] #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, #[doc = "Job execution constraints."] #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] pub limit_settings: Option, #[doc = "N-Cross validations value."] #[serde(rename = "nCrossValidations", default, skip_serializing_if = "Option::is_none")] pub n_cross_validations: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, #[serde(rename = "testData", default, skip_serializing_if = "Option::is_none")] pub test_data: Option, #[doc = "The fraction of test dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] @@ -13285,18 +11086,9 @@ pub struct TableVerticalLimitSettings { #[doc = "Max cores per iteration."] #[serde(rename = "maxCoresPerTrial", default, skip_serializing_if = "Option::is_none")] pub max_cores_per_trial: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, #[doc = "Number of iterations."] #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] pub max_trials: Option, - #[doc = "Number of concurrent sweeping runs that user wants to trigger."] - #[serde(rename = "sweepConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_concurrent_trials: Option, - #[doc = "Number of sweeping runs that user wants to trigger."] - #[serde(rename = "sweepTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_trials: Option, #[doc = "AutoML job timeout."] #[serde(default, skip_serializing_if = "Option::is_none")] pub timeout: Option, @@ -13563,43 +11355,6 @@ impl TensorFlow { } } } -#[doc = "Annotation type of text data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TextAnnotationType")] -pub enum TextAnnotationType { - Classification, - NamedEntityRecognition, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TextAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TextAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TextAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TextAnnotationType", 0u32, "Classification"), - Self::NamedEntityRecognition => serializer.serialize_unit_variant("TextAnnotationType", 1u32, "NamedEntityRecognition"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Text Classification task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TextClassification { @@ -13660,17 +11415,6 @@ impl TextNer { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TmpfsOptions { - #[doc = "Mention the Tmpfs size"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, -} -impl TmpfsOptions { - pub fn new() -> Self { - Self::default() - } -} #[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackedResource { @@ -13691,45 +11435,6 @@ impl TrackedResource { } } } -#[doc = "Training mode dictates whether to use distributed training or not"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TrainingMode")] -pub enum TrainingMode { - Auto, - Distributed, - NonDistributed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TrainingMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TrainingMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TrainingMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TrainingMode", 0u32, "Auto"), - Self::Distributed => serializer.serialize_unit_variant("TrainingMode", 1u32, "Distributed"), - Self::NonDistributed => serializer.serialize_unit_variant("TrainingMode", 2u32, "NonDistributed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Training related configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TrainingSettings { @@ -13754,9 +11459,6 @@ pub struct TrainingSettings { #[doc = "Advances setting to customize StackEnsemble run."] #[serde(rename = "stackEnsembleSettings", default, skip_serializing_if = "Option::is_none")] pub stack_ensemble_settings: Option, - #[doc = "Training mode dictates whether to use distributed training or not"] - #[serde(rename = "trainingMode", default, skip_serializing_if = "Option::is_none")] - pub training_mode: Option, } impl TrainingSettings { pub fn new() -> Self { @@ -14292,28 +11994,6 @@ impl UserAssignedIdentity { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedAcrAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedStorageAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} #[doc = "User identity configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserIdentity { @@ -14558,99 +12238,6 @@ impl VirtualMachineSshCredentials { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeDefinition { - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Indicate whether to mount volume as readOnly. Default value for this is false."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option, - #[doc = "Source of the mount. For bind mounts this is the host path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Target of the mount. For bind mounts this is the path in the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Consistency of the volume"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub consistency: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bind: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub volume: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tmpfs: Option, -} -impl VolumeDefinition { - pub fn new() -> Self { - Self::default() - } -} -pub mod volume_definition { - use super::*; - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "bind")] - Bind, - #[serde(rename = "volume")] - Volume, - #[serde(rename = "tmpfs")] - Tmpfs, - #[serde(rename = "npipe")] - Npipe, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bind => serializer.serialize_unit_variant("Type", 0u32, "bind"), - Self::Volume => serializer.serialize_unit_variant("Type", 1u32, "volume"), - Self::Tmpfs => serializer.serialize_unit_variant("Type", 2u32, "tmpfs"), - Self::Npipe => serializer.serialize_unit_variant("Type", 3u32, "npipe"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Bind - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeOptions { - #[doc = "Indicate whether volume is nocopy"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nocopy: Option, -} -impl VolumeOptions { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Enum of weekday"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "WeekDay")] @@ -14718,8 +12305,6 @@ pub struct Workspace { #[doc = "The resource model definition representing SKU"] #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, } impl Workspace { pub fn new() -> Self { @@ -14727,18 +12312,6 @@ impl Workspace { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionAccessKey { - #[serde(rename = "accessKeyId", default, skip_serializing_if = "Option::is_none")] - pub access_key_id: Option, - #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, -} -impl WorkspaceConnectionAccessKey { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceConnectionManagedIdentity { #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] pub resource_id: Option, @@ -14830,14 +12403,12 @@ pub mod workspace_connection_properties_v2 { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(tag = "authType")] pub enum WorkspaceConnectionPropertiesV2Union { - AccessKey(AccessKeyAuthTypeWorkspaceConnectionProperties), ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), None(NoneAuthTypeWorkspaceConnectionProperties), #[serde(rename = "PAT")] Pat(PatAuthTypeWorkspaceConnectionProperties), #[serde(rename = "SAS")] Sas(SasAuthTypeWorkspaceConnectionProperties), - ServicePrincipal(ServicePrincipalAuthTypeWorkspaceConnectionProperties), UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -14877,20 +12448,6 @@ impl WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionServicePrincipal { - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, -} -impl WorkspaceConnectionServicePrincipal { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceConnectionSharedAccessSignature { #[serde(default, skip_serializing_if = "Option::is_none")] pub sas: Option, @@ -15022,17 +12579,6 @@ pub struct WorkspaceProperties { #[doc = "Enabling v1_legacy_mode may prevent you from using features provided by the v2 API."] #[serde(rename = "v1LegacyMode", default, skip_serializing_if = "Option::is_none")] pub v1_legacy_mode: Option, - #[doc = "The timestamp when the workspace was soft deleted"] - #[serde(rename = "softDeletedAt", default, skip_serializing_if = "Option::is_none")] - pub soft_deleted_at: Option, - #[doc = "The timestamp when the soft deleted workspace is going to be purged"] - #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")] - pub scheduled_purge_date: Option, - #[doc = "The auth mode used for accessing the system datastores of the workspace"] - #[serde(rename = "systemDatastoresAuthMode", default, skip_serializing_if = "Option::is_none")] - pub system_datastores_auth_mode: Option, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, } impl WorkspaceProperties { pub fn new() -> Self { @@ -15052,7 +12598,6 @@ pub mod workspace_properties { Succeeded, Failed, Canceled, - SoftDeleted, #[serde(skip_deserializing)] UnknownValue(String), } @@ -15085,7 +12630,6 @@ pub mod workspace_properties { Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), - Self::SoftDeleted => serializer.serialize_unit_variant("ProvisioningState", 7u32, "SoftDeleted"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -15154,10 +12698,6 @@ pub struct WorkspacePropertiesUpdateParameters { #[doc = "ARM id of the container registry associated with this workspace."] #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] pub container_registry: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encryption: Option, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, } impl WorkspacePropertiesUpdateParameters { pub fn new() -> Self { diff --git a/services/mgmt/machinelearningservices/src/package_preview_2022_12/mod.rs b/services/mgmt/machinelearningservices/src/package_2023_04/mod.rs similarity index 95% rename from services/mgmt/machinelearningservices/src/package_preview_2022_12/mod.rs rename to services/mgmt/machinelearningservices/src/package_2023_04/mod.rs index 1bb72345d5..3b6129e883 100644 --- a/services/mgmt/machinelearningservices/src/package_preview_2022_12/mod.rs +++ b/services/mgmt/machinelearningservices/src/package_2023_04/mod.rs @@ -142,9 +142,6 @@ impl Client { pub fn jobs_client(&self) -> jobs::Client { jobs::Client(self.clone()) } - pub fn labeling_jobs_client(&self) -> labeling_jobs::Client { - labeling_jobs::Client(self.clone()) - } pub fn model_containers_client(&self) -> model_containers::Client { model_containers::Client(self.clone()) } @@ -184,6 +181,12 @@ impl Client { pub fn registry_component_versions_client(&self) -> registry_component_versions::Client { registry_component_versions::Client(self.clone()) } + pub fn registry_data_containers_client(&self) -> registry_data_containers::Client { + registry_data_containers::Client(self.clone()) + } + pub fn registry_data_versions_client(&self) -> registry_data_versions::Client { + registry_data_versions::Client(self.clone()) + } pub fn registry_environment_containers_client(&self) -> registry_environment_containers::Client { registry_environment_containers::Client(self.clone()) } @@ -223,7 +226,7 @@ pub mod operations { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all of the available Azure Machine Learning Services REST API operations."] + #[doc = "Lists all of the available Azure Machine Learning Workspaces REST API operations."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } @@ -314,7 +317,7 @@ pub mod operations { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -683,7 +686,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -792,7 +795,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -929,7 +932,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1059,7 +1062,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1148,7 +1151,7 @@ pub mod workspaces { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1192,7 +1195,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1307,7 +1310,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1404,7 +1407,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1507,7 +1510,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1595,7 +1598,7 @@ pub mod workspaces { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1638,7 +1641,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1729,7 +1732,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -1837,7 +1840,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2003,7 +2006,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2112,7 +2115,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2214,7 +2217,7 @@ pub mod workspaces { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2331,7 +2334,7 @@ pub mod usages { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2372,7 +2375,7 @@ pub mod usages { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2488,7 +2491,7 @@ pub mod virtual_machine_sizes { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2637,7 +2640,7 @@ pub mod quotas { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2732,7 +2735,7 @@ pub mod quotas { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2773,7 +2776,7 @@ pub mod quotas { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -2905,31 +2908,6 @@ pub mod compute { underlying_resource_action: underlying_resource_action.into(), } } - #[doc = "Updates the custom services list. The list of custom services provided shall be overwritten"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `custom_services`: New list of Custom Services."] - pub fn update_custom_services( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - custom_services: Vec, - ) -> update_custom_services::RequestBuilder { - update_custom_services::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - custom_services, - } - } #[doc = "Get the details (e.g IP address, port etc) of all the compute nodes in the compute."] #[doc = ""] #[doc = "Arguments:"] @@ -3040,31 +3018,6 @@ pub mod compute { compute_name: compute_name.into(), } } - #[doc = "Updates the idle shutdown setting of a compute instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: The object for updating idle shutdown setting of specified ComputeInstance."] - pub fn update_idle_shutdown_setting( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> update_idle_shutdown_setting::RequestBuilder { - update_idle_shutdown_setting::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } } pub mod list { use super::models; @@ -3150,7 +3103,7 @@ pub mod compute { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3195,7 +3148,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -3293,7 +3246,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -3415,7 +3368,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -3554,7 +3507,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -3706,95 +3659,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - } - pub mod update_custom_services { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) custom_services: Vec, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.custom_services)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/customServices" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -3879,7 +3744,7 @@ pub mod compute { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3923,7 +3788,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4022,7 +3887,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4127,7 +3992,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4220,7 +4085,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4313,95 +4178,7 @@ pub mod compute { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - } - pub mod update_idle_shutdown_setting { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::IdleShutdownSetting, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/updateIdleShutdownSetting" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4591,7 +4368,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4682,7 +4459,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4787,7 +4564,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -4885,7 +4662,7 @@ pub mod private_endpoint_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -5010,7 +4787,7 @@ pub mod private_link_resources { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -5212,7 +4989,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -5324,7 +5101,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -5429,7 +5206,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -5528,7 +5305,7 @@ pub mod workspace_connections { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5576,7 +5353,7 @@ pub mod workspace_connections { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -5596,7 +5373,7 @@ pub mod registry_code_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] pub fn list( &self, subscription_id: impl Into, @@ -5611,12 +5388,12 @@ pub mod registry_code_containers { skip: None, } } - #[doc = "Get container."] + #[doc = "Get Code container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `code_name`: Container name."] pub fn get( &self, @@ -5633,12 +5410,12 @@ pub mod registry_code_containers { code_name: code_name.into(), } } - #[doc = "Create or update container."] + #[doc = "Create or update Code container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `code_name`: Container name."] #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( @@ -5658,12 +5435,12 @@ pub mod registry_code_containers { body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Delete Code container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `code_name`: Container name."] pub fn delete( &self, @@ -5765,7 +5542,7 @@ pub mod registry_code_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5810,7 +5587,7 @@ pub mod registry_code_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -5908,7 +5685,7 @@ pub mod registry_code_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -6038,7 +5815,7 @@ pub mod registry_code_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -6163,7 +5940,7 @@ pub mod registry_code_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -6183,7 +5960,7 @@ pub mod registry_code_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `code_name`: Container name."] pub fn list( &self, @@ -6208,7 +5985,7 @@ pub mod registry_code_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `code_name`: Container name."] #[doc = "* `version`: Version identifier."] pub fn get( @@ -6233,7 +6010,7 @@ pub mod registry_code_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `code_name`: Container name."] #[doc = "* `version`: Version identifier."] #[doc = "* `body`: Version entity to create or update."] @@ -6261,7 +6038,7 @@ pub mod registry_code_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `code_name`: Container name."] #[doc = "* `version`: Version identifier."] pub fn delete( @@ -6281,6 +6058,34 @@ pub mod registry_code_versions { version: version.into(), } } + #[doc = "Generate a storage location and credential for the client to upload a code asset to."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `code_name`: Pending upload name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Pending upload request object"] + pub fn create_or_get_start_pending_upload( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + code_name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_get_start_pending_upload::RequestBuilder { + create_or_get_start_pending_upload::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + code_name: code_name.into(), + version: version.into(), + body: body.into(), + } + } } pub mod list { use super::models; @@ -6379,7 +6184,7 @@ pub mod registry_code_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6431,7 +6236,7 @@ pub mod registry_code_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -6531,7 +6336,7 @@ pub mod registry_code_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -6663,7 +6468,7 @@ pub mod registry_code_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -6790,39 +6595,145 @@ pub mod registry_code_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } -} -pub mod registry_component_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, + pub mod create_or_get_start_pending_upload { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PendingUploadResponseDto = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) registry_name: String, + pub(crate) code_name: String, + pub(crate) version: String, + pub(crate) body: models::PendingUploadRequestDto, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . code_name , & self . version)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod registry_component_containers { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List containers."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + skip: None, } } #[doc = "Get container."] @@ -6830,7 +6741,7 @@ pub mod registry_component_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `component_name`: Container name."] pub fn get( &self, @@ -6852,7 +6763,7 @@ pub mod registry_component_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `component_name`: Container name."] #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( @@ -6877,7 +6788,7 @@ pub mod registry_component_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `component_name`: Container name."] pub fn delete( &self, @@ -6981,7 +6892,7 @@ pub mod registry_component_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7026,7 +6937,7 @@ pub mod registry_component_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -7124,7 +7035,7 @@ pub mod registry_component_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -7254,7 +7165,7 @@ pub mod registry_component_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -7379,7 +7290,7 @@ pub mod registry_component_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -7399,7 +7310,7 @@ pub mod registry_component_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `component_name`: Container name."] pub fn list( &self, @@ -7424,7 +7335,7 @@ pub mod registry_component_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `component_name`: Container name."] #[doc = "* `version`: Version identifier."] pub fn get( @@ -7449,7 +7360,7 @@ pub mod registry_component_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `component_name`: Container name."] #[doc = "* `version`: Version identifier."] #[doc = "* `body`: Version entity to create or update."] @@ -7477,7 +7388,7 @@ pub mod registry_component_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] #[doc = "* `component_name`: Container name."] #[doc = "* `version`: Version identifier."] pub fn delete( @@ -7595,7 +7506,7 @@ pub mod registry_component_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7640,7 +7551,7 @@ pub mod registry_component_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -7732,7 +7643,7 @@ pub mod registry_component_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -7856,7 +7767,7 @@ pub mod registry_component_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -7975,14 +7886,14 @@ pub mod registry_component_versions { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod registry_environment_containers { +pub mod registry_data_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -7990,12 +7901,12 @@ pub mod registry_environment_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List environment containers."] + #[doc = "List Data containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] pub fn list( &self, subscription_id: impl Into, @@ -8016,21 +7927,21 @@ pub mod registry_environment_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Container name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - environment_name: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - environment_name: environment_name.into(), + name: name.into(), } } #[doc = "Create or update container."] @@ -8038,23 +7949,23 @@ pub mod registry_environment_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Container name."] #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - environment_name: impl Into, - body: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - environment_name: environment_name.into(), + name: name.into(), body: body.into(), } } @@ -8063,21 +7974,21 @@ pub mod registry_environment_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Container name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - environment_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - environment_name: environment_name.into(), + name: name.into(), } } } @@ -8090,9 +8001,9 @@ pub mod registry_environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8150,9 +8061,7 @@ pub mod registry_environment_containers { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -8173,7 +8082,7 @@ pub mod registry_environment_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8212,7 +8121,7 @@ pub mod registry_environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -8221,7 +8130,7 @@ pub mod registry_environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -8236,9 +8145,9 @@ pub mod registry_environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8282,7 +8191,7 @@ pub mod registry_environment_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8309,24 +8218,24 @@ pub mod registry_environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.registry_name, - &self.environment_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8346,9 +8255,9 @@ pub mod registry_environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8410,8 +8319,8 @@ pub mod registry_environment_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) body: models::EnvironmentContainerResource, + pub(crate) name: String, + pub(crate) body: models::DataContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8439,24 +8348,24 @@ pub mod registry_environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.registry_name, - &self.environment_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] @@ -8537,7 +8446,7 @@ pub mod registry_environment_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8564,24 +8473,24 @@ pub mod registry_environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.registry_name, - &self.environment_name + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod registry_environment_versions { +pub mod registry_data_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -8589,29 +8498,30 @@ pub mod registry_environment_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List versions."] + #[doc = "List data versions in the data container"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Data container's name"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - environment_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - environment_name: environment_name.into(), + name: name.into(), order_by: None, top: None, skip: None, + tags: None, list_view_type: None, } } @@ -8620,15 +8530,15 @@ pub mod registry_environment_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - environment_name: impl Into, + name: impl Into, version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { @@ -8636,7 +8546,7 @@ pub mod registry_environment_versions { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - environment_name: environment_name.into(), + name: name.into(), version: version.into(), } } @@ -8645,8 +8555,8 @@ pub mod registry_environment_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Container name."] #[doc = "* `version`: Version identifier."] #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( @@ -8654,16 +8564,16 @@ pub mod registry_environment_versions { subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - environment_name: impl Into, + name: impl Into, version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - environment_name: environment_name.into(), + name: name.into(), version: version.into(), body: body.into(), } @@ -8673,15 +8583,15 @@ pub mod registry_environment_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `environment_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Container name."] #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - environment_name: impl Into, + name: impl Into, version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { @@ -8689,8 +8599,36 @@ pub mod registry_environment_versions { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - environment_name: environment_name.into(), + name: name.into(), + version: version.into(), + } + } + #[doc = "Generate a storage location and credential for the client to upload a data asset to."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `name`: Data asset name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Pending upload request object"] + pub fn create_or_get_start_pending_upload( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_get_start_pending_upload::RequestBuilder { + create_or_get_start_pending_upload::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + name: name.into(), version: version.into(), + body: body.into(), } } } @@ -8703,9 +8641,9 @@ pub mod registry_environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8749,19 +8687,20 @@ pub mod registry_environment_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) name: String, pub(crate) order_by: Option, pub(crate) top: Option, pub(crate) skip: Option, + pub(crate) tags: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] + #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] pub fn order_by(mut self, order_by: impl Into) -> Self { self.order_by = Some(order_by.into()); self } - #[doc = "Maximum number of records to return."] + #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self @@ -8771,14 +8710,17 @@ pub mod registry_environment_versions { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -8799,7 +8741,7 @@ pub mod registry_environment_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8822,6 +8764,9 @@ pub mod registry_environment_versions { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("$tags", tags); + } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -8843,11 +8788,18 @@ pub mod registry_environment_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -8862,9 +8814,9 @@ pub mod registry_environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8908,7 +8860,7 @@ pub mod registry_environment_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) name: String, pub(crate) version: String, } impl RequestBuilder { @@ -8935,18 +8887,26 @@ pub mod registry_environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8966,9 +8926,9 @@ pub mod registry_environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9030,9 +8990,9 @@ pub mod registry_environment_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) name: String, pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, + pub(crate) body: models::DataVersionBaseResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9059,18 +9019,26 @@ pub mod registry_environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] @@ -9151,7 +9119,7 @@ pub mod registry_environment_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) environment_name: String, + pub(crate) name: String, pub(crate) version: String, } impl RequestBuilder { @@ -9178,18 +9146,132 @@ pub mod registry_environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.name, + &self.version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } + pub mod create_or_get_start_pending_upload { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PendingUploadResponseDto = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) registry_name: String, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::PendingUploadRequestDto, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod registry_model_containers { +pub mod registry_environment_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9197,12 +9279,12 @@ pub mod registry_model_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List model containers."] + #[doc = "List environment containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] pub fn list( &self, subscription_id: impl Into, @@ -9223,45 +9305,45 @@ pub mod registry_model_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `environment_name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - model_name: impl Into, + environment_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - model_name: model_name.into(), + environment_name: environment_name.into(), } } - #[doc = "Create or update model container."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `environment_name`: Container name."] #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - model_name: impl Into, - body: impl Into, + environment_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - model_name: model_name.into(), + environment_name: environment_name.into(), body: body.into(), } } @@ -9270,21 +9352,21 @@ pub mod registry_model_containers { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `environment_name`: Container name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - model_name: impl Into, + environment_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - model_name: model_name.into(), + environment_name: environment_name.into(), } } } @@ -9297,9 +9379,9 @@ pub mod registry_model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9357,7 +9439,9 @@ pub mod registry_model_containers { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -9378,7 +9462,7 @@ pub mod registry_model_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -9417,7 +9501,7 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -9426,7 +9510,7 @@ pub mod registry_model_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -9441,9 +9525,9 @@ pub mod registry_model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9487,7 +9571,7 @@ pub mod registry_model_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) model_name: String, + pub(crate) environment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9514,24 +9598,24 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.registry_name, - &self.model_name + &self.environment_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9551,9 +9635,9 @@ pub mod registry_model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9615,8 +9699,8 @@ pub mod registry_model_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) body: models::ModelContainerResource, + pub(crate) environment_name: String, + pub(crate) body: models::EnvironmentContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9644,24 +9728,24 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.registry_name, - &self.model_name + &self.environment_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] @@ -9742,7 +9826,7 @@ pub mod registry_model_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) model_name: String, + pub(crate) environment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9769,24 +9853,24 @@ pub mod registry_model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.registry_name, - &self.model_name + &self.environment_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod registry_model_versions { +pub mod registry_environment_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -9799,28 +9883,24 @@ pub mod registry_model_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `environment_name`: Container name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - model_name: impl Into, + environment_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - model_name: model_name.into(), - skip: None, + environment_name: environment_name.into(), order_by: None, top: None, - version: None, - description: None, - tags: None, - properties: None, + skip: None, list_view_type: None, } } @@ -9829,15 +9909,15 @@ pub mod registry_model_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name. This is case-sensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `environment_name`: Container name. This is case-sensitive."] #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - model_name: impl Into, + environment_name: impl Into, version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { @@ -9845,7 +9925,7 @@ pub mod registry_model_versions { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - model_name: model_name.into(), + environment_name: environment_name.into(), version: version.into(), } } @@ -9854,8 +9934,8 @@ pub mod registry_model_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `environment_name`: Container name."] #[doc = "* `version`: Version identifier."] #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( @@ -9863,16 +9943,16 @@ pub mod registry_model_versions { subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - model_name: impl Into, + environment_name: impl Into, version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - model_name: model_name.into(), + environment_name: environment_name.into(), version: version.into(), body: body.into(), } @@ -9882,15 +9962,15 @@ pub mod registry_model_versions { #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry."] - #[doc = "* `model_name`: Container name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `environment_name`: Container name."] #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, registry_name: impl Into, - model_name: impl Into, + environment_name: impl Into, version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { @@ -9898,7 +9978,7 @@ pub mod registry_model_versions { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), registry_name: registry_name.into(), - model_name: model_name.into(), + environment_name: environment_name.into(), version: version.into(), } } @@ -9912,9 +9992,9 @@ pub mod registry_model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9958,22 +10038,13 @@ pub mod registry_model_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) skip: Option, + pub(crate) environment_name: String, pub(crate) order_by: Option, pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, + pub(crate) skip: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } #[doc = "Ordering of list."] pub fn order_by(mut self, order_by: impl Into) -> Self { self.order_by = Some(order_by.into()); @@ -9984,24 +10055,9 @@ pub mod registry_model_versions { self.top = Some(top); self } - #[doc = "Version identifier."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); self } #[doc = "View type for including/excluding (for example) archived entities."] @@ -10009,7 +10065,9 @@ pub mod registry_model_versions { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -10030,7 +10088,7 @@ pub mod registry_model_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10044,26 +10102,14 @@ pub mod registry_model_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } if let Some(order_by) = &this.order_by { req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); @@ -10086,18 +10132,11 @@ pub mod registry_model_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -10112,9 +10151,9 @@ pub mod registry_model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10158,7 +10197,7 @@ pub mod registry_model_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) model_name: String, + pub(crate) environment_name: String, pub(crate) version: String, } impl RequestBuilder { @@ -10185,26 +10224,18 @@ pub mod registry_model_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10224,9 +10255,9 @@ pub mod registry_model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10288,9 +10319,9 @@ pub mod registry_model_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) model_name: String, + pub(crate) environment_name: String, pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, + pub(crate) body: models::EnvironmentVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10317,26 +10348,18 @@ pub mod registry_model_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] @@ -10417,7 +10440,7 @@ pub mod registry_model_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) model_name: String, + pub(crate) environment_name: String, pub(crate) version: String, } impl RequestBuilder { @@ -10444,26 +10467,18 @@ pub mod registry_model_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod batch_endpoints { +pub mod registry_model_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -10471,141 +10486,94 @@ pub mod batch_endpoints { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists Batch inference endpoint in the workspace."] + #[doc = "List model containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - workspace_name: impl Into, + registry_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - count: None, + registry_name: registry_name.into(), skip: None, + list_view_type: None, } } - #[doc = "Gets a batch inference endpoint by name."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, + registry_name: impl Into, + model_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), } } - #[doc = "Creates a batch inference endpoint (asynchronous)."] + #[doc = "Create or update model container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Batch inference endpoint definition object."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Container name."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, + registry_name: impl Into, + model_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Mutable batch inference endpoint definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), body: body.into(), } } - #[doc = "Delete Batch Inference Endpoint (asynchronous)."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Container name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, + registry_name: impl Into, + model_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Lists batch Inference Endpoint keys."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), } } } @@ -10618,9 +10586,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10663,24 +10631,22 @@ pub mod batch_endpoints { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) count: Option, + pub(crate) registry_name: String, pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -10701,7 +10667,7 @@ pub mod batch_endpoints { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10715,12 +10681,12 @@ pub mod batch_endpoints { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -10740,16 +10706,16 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name + &self.registry_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -10764,9 +10730,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10809,8 +10775,8 @@ pub mod batch_endpoints { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) registry_name: String, + pub(crate) model_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10837,24 +10803,24 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name + &self.registry_name, + &self.model_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10874,9 +10840,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10918,13 +10884,16 @@ pub mod batch_endpoints { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] + #[doc = r" This [`RequestBuilder`] implements a request that returns an"] + #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] + #[doc = r" implementation does not support polling the status of the"] + #[doc = r" operation, however future versions of this crate may include"] + #[doc = r" this support."] #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request. Future versions may poll the service"] + #[doc = r" until the operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] #[doc = r" until the operation completes, use"] @@ -10934,9 +10903,9 @@ pub mod batch_endpoints { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::BatchEndpointTrackedResource, + pub(crate) registry_name: String, + pub(crate) model_name: String, + pub(crate) body: models::ModelContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10964,63 +10933,37 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name + &self.registry_name, + &self.model_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11029,11 +10972,6 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -11092,9 +11030,8 @@ pub mod batch_endpoints { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, + pub(crate) registry_name: String, + pub(crate) model_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11106,15 +11043,14 @@ pub mod batch_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -11122,174 +11058,169 @@ pub mod batch_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name + &self.registry_name, + &self.model_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() +} +pub mod registry_model_versions { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List versions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Container name. This is case-sensitive."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + model_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), + skip: None, + order_by: None, + top: None, + version: None, + description: None, + tags: None, + properties: None, + list_view_type: None, } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Get version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + model_name: impl Into, + version: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), + version: version.into(), } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + #[doc = "Create or update version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Container name."] + #[doc = "* `version`: Version identifier."] + #[doc = "* `body`: Version entity to create or update."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + model_name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), + version: version.into(), + body: body.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + #[doc = "Delete version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Container name."] + #[doc = "* `version`: Version identifier."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + model_name: impl Into, + version: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), + version: version.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) + } + #[doc = "Generate a storage location and credential for the client to upload a model asset to."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `model_name`: Model name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Pending upload request object"] + pub fn create_or_get_start_pending_upload( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + model_name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_get_start_pending_upload::RequestBuilder { + create_or_get_start_pending_upload::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + model_name: model_name.into(), + version: version.into(), + body: body.into(), } } } - pub mod list_keys { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11298,9 +11229,9 @@ pub mod batch_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11343,276 +11274,59 @@ pub mod batch_endpoints { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) registry_name: String, + pub(crate) model_name: String, + pub(crate) skip: Option, + pub(crate) order_by: Option, + pub(crate) top: Option, + pub(crate) version: Option, + pub(crate) description: Option, + pub(crate) tags: Option, + pub(crate) properties: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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 = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self } - } - } -} -pub mod batch_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference deployments in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, + #[doc = "Version identifier."] + pub fn version(mut self, version: impl Into) -> Self { + self.version = Some(version.into()); + self } - } - #[doc = "Gets a batch inference deployment by id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch deployments."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Creates/updates a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: Inference deployment identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Model description."] + pub fn description(mut self, description: impl Into) -> Self { + self.description = Some(description.into()); + self } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); self } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); + #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] + pub fn properties(mut self, properties: impl Into) -> Self { + self.properties = Some(properties.into()); self } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -11633,7 +11347,7 @@ pub mod batch_deployments { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11647,14 +11361,29 @@ pub mod batch_deployments { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } if let Some(order_by) = &this.order_by { req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); + if let Some(version) = &this.version { + req.url_mut().query_pairs_mut().append_pair("version", version); + } + if let Some(description) = &this.description { + req.url_mut().query_pairs_mut().append_pair("description", description); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(properties) = &this.properties { + req.url_mut().query_pairs_mut().append_pair("properties", properties); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11674,11 +11403,18 @@ pub mod batch_deployments { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.model_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -11693,9 +11429,9 @@ pub mod batch_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11738,9 +11474,9 @@ pub mod batch_deployments { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, + pub(crate) registry_name: String, + pub(crate) model_name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11766,18 +11502,26 @@ pub mod batch_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.model_name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11797,9 +11541,9 @@ pub mod batch_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11841,13 +11585,16 @@ pub mod batch_deployments { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] + #[doc = r" This [`RequestBuilder`] implements a request that returns an"] + #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] + #[doc = r" implementation does not support polling the status of the"] + #[doc = r" operation, however future versions of this crate may include"] + #[doc = r" this support."] #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request. Future versions may poll the service"] + #[doc = r" until the operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] #[doc = r" until the operation completes, use"] @@ -11857,11 +11604,11 @@ pub mod batch_deployments { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::BatchDeploymentTrackedResource, - } + pub(crate) registry_name: String, + pub(crate) model_name: String, + pub(crate) version: String, + pub(crate) body: models::ModelVersionResource, + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11887,57 +11634,39 @@ pub mod batch_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.model_name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -11946,11 +11675,6 @@ pub mod batch_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; - Ok(body) - } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -12009,10 +11733,9 @@ pub mod batch_deployments { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + pub(crate) registry_name: String, + pub(crate) model_name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12024,72 +11747,39 @@ pub mod batch_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name, + &self.model_name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } } - pub mod delete { + pub mod create_or_get_start_pending_upload { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12098,15 +11788,17 @@ pub mod batch_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PendingUploadResponseDto = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -12118,47 +11810,33 @@ pub mod batch_deployments { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, + pub(crate) registry_name: String, + pub(crate) model_name: String, + pub(crate) version: String, + pub(crate) body: models::PendingUploadRequestDto, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12170,32 +11848,45 @@ pub mod batch_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . model_name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod code_containers { +pub mod batch_endpoints { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12203,7 +11894,7 @@ pub mod code_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List containers."] + #[doc = "Lists Batch inference endpoint in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -12220,92 +11911,140 @@ pub mod code_containers { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + count: None, skip: None, } } - #[doc = "Get container."] + #[doc = "Gets a batch inference endpoint by name."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, + endpoint_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates a batch inference endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] + #[doc = "* `body`: Batch inference endpoint definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - body: impl Into, + endpoint_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Update a batch inference endpoint (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] + #[doc = "* `body`: Mutable batch inference endpoint definition object."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), + } + } + #[doc = "Delete Batch Inference Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference Endpoint name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, + endpoint_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), } } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; - Ok(body) + #[doc = "Lists batch Inference Endpoint keys."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference Endpoint name."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BatchEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { self.0 @@ -12348,15 +12087,23 @@ pub mod code_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) count: Option, pub(crate) skip: Option, } impl RequestBuilder { + #[doc = "Number of endpoints to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -12377,7 +12124,7 @@ pub mod code_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12391,6 +12138,9 @@ pub mod code_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } @@ -12413,7 +12163,7 @@ pub mod code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -12422,7 +12172,7 @@ pub mod code_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -12437,9 +12187,9 @@ pub mod code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12483,7 +12233,7 @@ pub mod code_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12510,24 +12260,24 @@ pub mod code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -12547,9 +12297,9 @@ pub mod code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12558,6 +12308,9 @@ pub mod code_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -12569,32 +12322,47 @@ pub mod code_containers { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This [`RequestBuilder`] implements a request that returns an"] + #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] + #[doc = r" implementation does not support polling the status of the"] + #[doc = r" operation, however future versions of this crate may include"] + #[doc = r" this support."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" executes the request. Future versions may poll the service"] + #[doc = r" until the operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::CodeContainerResource, + pub(crate) endpoint_name: String, + pub(crate) body: models::BatchEndpointTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12622,26 +12390,28 @@ pub mod code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] + #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -12650,7 +12420,7 @@ pub mod code_containers { } } } - pub mod delete { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12659,12 +12429,20 @@ pub mod code_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BatchEndpointTrackedResource = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -12676,31 +12454,47 @@ pub mod code_containers { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, + pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12712,14 +12506,15 @@ pub mod code_containers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -12727,136 +12522,63 @@ pub mod code_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - } -} -pub mod code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) } } } - pub mod list { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -12865,17 +12587,15 @@ pub mod code_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -12887,131 +12607,89 @@ pub mod code_versions { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) endpoint_name: String, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2022-12-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.endpoint_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } - pub mod get { + pub mod list_keys { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13020,9 +12698,9 @@ pub mod code_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; + let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13066,8 +12744,7 @@ pub mod code_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, + pub(crate) endpoint_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13079,7 +12756,7 @@ pub mod code_versions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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( @@ -13087,32 +12764,25 @@ pub mod code_versions { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -13123,217 +12793,8 @@ pub mod code_versions { } } } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - } } -pub mod component_containers { +pub mod batch_deployments { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13341,109 +12802,150 @@ pub mod component_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List component containers."] + #[doc = "Lists Batch inference deployments in the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Endpoint name"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + endpoint_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + order_by: None, + top: None, skip: None, - list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Gets a batch inference deployment by id."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] + #[doc = "* `endpoint_name`: Endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch deployments."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates/updates a batch inference deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `endpoint_name`: Inference endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] + #[doc = "* `body`: Batch inference deployment definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - body: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Update a batch inference deployment (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn delete( + #[doc = "* `endpoint_name`: Inference endpoint name"] + #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] + #[doc = "* `body`: Batch inference deployment definition object."] + pub fn update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), } } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { + #[doc = "Delete Batch Inference deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Endpoint name"] + #[doc = "* `deployment_name`: Inference deployment identifier."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13487,23 +12989,30 @@ pub mod component_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Top of list."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } pub fn into_stream( self, - ) -> azure_core::Pageable { + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -13524,7 +13033,7 @@ pub mod component_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13538,12 +13047,15 @@ pub mod component_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -13562,17 +13074,11 @@ pub mod component_containers { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -13587,9 +13093,9 @@ pub mod component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13633,7 +13139,8 @@ pub mod component_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13659,25 +13166,18 @@ pub mod component_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -13697,9 +13197,9 @@ pub mod component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::BatchDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13708,6 +13208,9 @@ pub mod component_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -13719,32 +13222,48 @@ pub mod component_containers { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This [`RequestBuilder`] implements a request that returns an"] + #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] + #[doc = r" implementation does not support polling the status of the"] + #[doc = r" operation, however future versions of this crate may include"] + #[doc = r" this support."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" executes the request. Future versions may poll the service"] + #[doc = r" until the operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ComponentContainerResource, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::BatchDeploymentTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13771,27 +13290,22 @@ pub mod component_containers { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] + #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -13800,7 +13314,7 @@ pub mod component_containers { } } } - pub mod delete { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -13809,12 +13323,20 @@ pub mod component_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BatchDeploymentTrackedResource = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -13826,31 +13348,48 @@ pub mod component_containers { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -13862,87 +13401,218 @@ pub mod component_containers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - } -} -pub mod component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List component versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Component name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - } - } - #[doc = "Get version."] + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } +} +pub mod code_containers { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + } + } + #[doc = "Get container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -13950,26 +13620,23 @@ pub mod component_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } - #[doc = "Create or update version."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -13977,25 +13644,22 @@ pub mod component_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -14003,7 +13667,6 @@ pub mod component_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } } @@ -14016,9 +13679,9 @@ pub mod component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14062,34 +13725,15 @@ pub mod component_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -14110,7 +13754,7 @@ pub mod component_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14124,18 +13768,9 @@ pub mod component_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -14154,11 +13789,17 @@ pub mod component_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -14173,9 +13814,9 @@ pub mod component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14220,7 +13861,6 @@ pub mod component_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14246,18 +13886,25 @@ pub mod component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14277,9 +13924,9 @@ pub mod component_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::CodeContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14324,8 +13971,7 @@ pub mod component_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, + pub(crate) body: models::CodeContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14352,18 +13998,25 @@ pub mod component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14425,7 +14078,6 @@ pub mod component_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14451,18 +14103,25 @@ pub mod component_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod data_containers { +pub mod code_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -14470,40 +14129,48 @@ pub mod data_containers { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List data containers."] + #[doc = "List versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, skip: None, - list_view_type: None, + hash: None, + hash_version: None, } } - #[doc = "Get container."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -14511,23 +14178,26 @@ pub mod data_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } - #[doc = "Create or update container."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - body: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -14535,22 +14205,25 @@ pub mod data_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -14558,6 +14231,35 @@ pub mod data_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), + } + } + #[doc = "Generate a storage location and credential for the client to upload a code asset to."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Pending upload request object"] + pub fn create_or_get_start_pending_upload( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_get_start_pending_upload::RequestBuilder { + create_or_get_start_pending_upload::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), + body: body.into(), } } } @@ -14570,9 +14272,9 @@ pub mod data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14616,21 +14318,40 @@ pub mod data_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) list_view_type: Option, + pub(crate) hash: Option, + pub(crate) hash_version: Option, } impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); + #[doc = "If specified, return CodeVersion assets with specified content hash value, regardless of name"] + pub fn hash(mut self, hash: impl Into) -> Self { + self.hash = Some(hash.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Hash algorithm version when listing by hash"] + pub fn hash_version(mut self, hash_version: impl Into) -> Self { + self.hash_version = Some(hash_version.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -14651,7 +14372,7 @@ pub mod data_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14665,11 +14386,20 @@ pub mod data_containers { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + if let Some(hash) = &this.hash { + req.url_mut().query_pairs_mut().append_pair("hash", hash); + } + if let Some(hash_version) = &this.hash_version { + req.url_mut().query_pairs_mut().append_pair("hashVersion", hash_version); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14690,16 +14420,17 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -14714,9 +14445,9 @@ pub mod data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14761,6 +14492,7 @@ pub mod data_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14787,24 +14519,25 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14824,9 +14557,9 @@ pub mod data_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; + let body: models::CodeVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14871,7 +14604,8 @@ pub mod data_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::DataContainerResource, + pub(crate) version: String, + pub(crate) body: models::CodeVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -14899,24 +14633,25 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14978,6 +14713,7 @@ pub mod data_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15004,100 +14740,196 @@ pub mod data_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } -} -pub mod data_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data versions in the data container"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Data container's name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - tags: None, - list_view_type: None, + pub mod create_or_get_start_pending_upload { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PendingUploadResponseDto = 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 } } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::PendingUploadRequestDto, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod component_containers { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List component containers."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + list_view_type: None, + } + } + #[doc = "Get container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + } + } + #[doc = "Create or update container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + #[doc = "* `body`: Container entity to create or update."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15105,25 +14937,22 @@ pub mod data_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -15131,7 +14960,6 @@ pub mod data_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } } @@ -15144,9 +14972,9 @@ pub mod data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15190,40 +15018,23 @@ pub mod data_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) tags: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } #[doc = "Continuation token for pagination."] pub fn skip(mut self, skip: impl Into) -> Self { self.skip = Some(skip.into()); self } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] + #[doc = "View type for including/excluding (for example) archived entities."] pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -15244,7 +15055,7 @@ pub mod data_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15258,18 +15069,9 @@ pub mod data_versions { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -15292,17 +15094,16 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -15317,9 +15118,9 @@ pub mod data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15364,7 +15165,6 @@ pub mod data_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15391,25 +15191,24 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -15429,9 +15228,9 @@ pub mod data_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15476,8 +15275,7 @@ pub mod data_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, + pub(crate) body: models::ComponentContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15505,25 +15303,24 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -15585,7 +15382,6 @@ pub mod data_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -15612,25 +15408,24 @@ pub mod data_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod datastores { +pub mod component_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -15638,45 +15433,47 @@ pub mod datastores { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List datastores."] + #[doc = "List component versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Component name."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - skip: None, - count: None, - is_default: None, - names: Vec::new(), - search_text: None, + name: name.into(), order_by: None, - order_by_asc: None, + top: None, + skip: None, + list_view_type: None, } } - #[doc = "Get datastore."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -15684,23 +15481,26 @@ pub mod datastores { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), } } - #[doc = "Create or update datastore."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - #[doc = "* `body`: Datastore entity to create or update."] - pub fn create_or_update( + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] + #[doc = "* `body`: Version entity to create or update."] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - body: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -15708,23 +15508,25 @@ pub mod datastores { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), + version: version.into(), body: body.into(), - skip_validation: None, } } - #[doc = "Delete datastore."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -15732,28 +15534,7 @@ pub mod datastores { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - } - } - #[doc = "Get datastore secrets."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn list_secrets( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), + version: version.into(), } } } @@ -15766,9 +15547,9 @@ pub mod datastores { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15812,51 +15593,34 @@ pub mod datastores { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) is_default: Option, - pub(crate) names: Vec, - pub(crate) search_text: Option, + pub(crate) name: String, pub(crate) order_by: Option, - pub(crate) order_by_asc: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Filter down to the workspace default datastore."] - pub fn is_default(mut self, is_default: bool) -> Self { - self.is_default = Some(is_default); - self - } - #[doc = "Names of datastores to return."] - pub fn names(mut self, names: Vec) -> Self { - self.names = names; + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); self } - #[doc = "Text to search for in the datastore names."] - pub fn search_text(mut self, search_text: impl Into) -> Self { - self.search_text = Some(search_text.into()); + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); self } - #[doc = "Order by property (createdtime | modifiedtime | name)."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); self } - #[doc = "Order by property in ascending order."] - pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { - self.order_by_asc = Some(order_by_asc); + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -15877,7 +15641,7 @@ pub mod datastores { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15891,23 +15655,17 @@ pub mod datastores { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(is_default) = &this.is_default { - req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); } - if let Some(search_text) = &this.search_text { - req.url_mut().query_pairs_mut().append_pair("searchText", search_text); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(order_by_asc) = &this.order_by_asc { - req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15927,17 +15685,11 @@ pub mod datastores { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -15952,9 +15704,9 @@ pub mod datastores { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15999,6 +15751,7 @@ pub mod datastores { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -16024,25 +15777,18 @@ pub mod datastores { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16062,9 +15808,9 @@ pub mod datastores { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; + let body: models::ComponentVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16109,15 +15855,10 @@ pub mod datastores { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::DatastoreResource, - pub(crate) skip_validation: Option, + pub(crate) version: String, + pub(crate) body: models::ComponentVersionResource, } impl RequestBuilder { - #[doc = "Flag to skip validation."] - pub fn skip_validation(mut self, skip_validation: bool) -> Self { - self.skip_validation = Some(skip_validation); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16134,11 +15875,6 @@ pub mod datastores { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(skip_validation) = &this.skip_validation { - req.url_mut() - .query_pairs_mut() - .append_pair("skipValidation", &skip_validation.to_string()); - } req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -16147,25 +15883,18 @@ pub mod datastores { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16227,6 +15956,7 @@ pub mod datastores { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -16252,177 +15982,66 @@ pub mod datastores { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } - pub mod list_secrets { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreSecretsUnion = 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 +} +pub mod data_containers { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List data containers."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + list_view_type: None, } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod environment_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List environment containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), + #[doc = "Get container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } #[doc = "Create or update container."] @@ -16431,7 +16050,7 @@ pub mod environment_containers { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `name`: Container name."] #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, @@ -16439,7 +16058,7 @@ pub mod environment_containers { resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -16456,7 +16075,7 @@ pub mod environment_containers { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `name`: Container name."] pub fn delete( &self, subscription_id: impl Into, @@ -16482,9 +16101,9 @@ pub mod environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16542,9 +16161,7 @@ pub mod environment_containers { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -16565,7 +16182,7 @@ pub mod environment_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -16604,7 +16221,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16613,7 +16230,7 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -16628,9 +16245,9 @@ pub mod environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16701,7 +16318,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16711,14 +16328,14 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16738,9 +16355,9 @@ pub mod environment_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; + let body: models::DataContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16785,7 +16402,7 @@ pub mod environment_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) body: models::EnvironmentContainerResource, + pub(crate) body: models::DataContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -16813,7 +16430,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16823,14 +16440,14 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16918,7 +16535,7 @@ pub mod environment_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -16928,14 +16545,14 @@ pub mod environment_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod environment_versions { +pub mod data_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -16943,13 +16560,13 @@ pub mod environment_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List versions."] + #[doc = "List data versions in the data container"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `name`: Data container's name"] pub fn list( &self, subscription_id: impl Into, @@ -16966,6 +16583,7 @@ pub mod environment_versions { order_by: None, top: None, skip: None, + tags: None, list_view_type: None, } } @@ -16975,8 +16593,8 @@ pub mod environment_versions { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn get( &self, subscription_id: impl Into, @@ -16994,15 +16612,15 @@ pub mod environment_versions { version: version.into(), } } - #[doc = "Creates or updates an EnvironmentVersion."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] - #[doc = "* `version`: Version of EnvironmentVersion."] - #[doc = "* `body`: Definition of EnvironmentVersion."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, @@ -17010,7 +16628,7 @@ pub mod environment_versions { workspace_name: impl Into, name: impl Into, version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -17028,8 +16646,8 @@ pub mod environment_versions { #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `name`: Container name."] + #[doc = "* `version`: Version identifier."] pub fn delete( &self, subscription_id: impl Into, @@ -17057,9 +16675,9 @@ pub mod environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17107,15 +16725,16 @@ pub mod environment_versions { pub(crate) order_by: Option, pub(crate) top: Option, pub(crate) skip: Option, + pub(crate) tags: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Ordering of list."] + #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] pub fn order_by(mut self, order_by: impl Into) -> Self { self.order_by = Some(order_by.into()); self } - #[doc = "Maximum number of records to return."] + #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self @@ -17125,14 +16744,17 @@ pub mod environment_versions { self.skip = Some(skip.into()); self } - #[doc = "View type for including/excluding (for example) archived entities."] + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -17153,7 +16775,7 @@ pub mod environment_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17176,6 +16798,9 @@ pub mod environment_versions { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("$tags", tags); + } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } @@ -17197,11 +16822,18 @@ pub mod environment_versions { azure_core::Pageable::new(make_request) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -17216,9 +16848,9 @@ pub mod environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17289,18 +16921,26 @@ pub mod environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17320,9 +16960,9 @@ pub mod environment_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = serde_json::from_slice(&bytes)?; + let body: models::DataVersionBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17368,7 +17008,7 @@ pub mod environment_versions { pub(crate) workspace_name: String, pub(crate) name: String, pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, + pub(crate) body: models::DataVersionBaseResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -17395,18 +17035,26 @@ pub mod environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17494,18 +17142,26 @@ pub mod environment_versions { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name, + &self.version + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod jobs { +pub mod datastores { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -17513,7 +17169,7 @@ pub mod jobs { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists Jobs in the workspace."] + #[doc = "List datastores."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -17531,102 +17187,104 @@ pub mod jobs { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), skip: None, - job_type: None, - tag: None, - list_view_type: None, - scheduled: None, - schedule_id: None, + count: None, + is_default: None, + names: Vec::new(), + search_text: None, + order_by: None, + order_by_asc: None, } } - #[doc = "Gets a Job by name/id."] + #[doc = "Get datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + #[doc = "* `name`: Datastore name."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), } } - #[doc = "Creates and executes a Job."] + #[doc = "Create or update datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - #[doc = "* `body`: Job definition object."] + #[doc = "* `name`: Datastore name."] + #[doc = "* `body`: Datastore entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, - body: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), body: body.into(), + skip_validation: None, } } - #[doc = "Deletes a Job (asynchronous)."] + #[doc = "Delete datastore."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + #[doc = "* `name`: Datastore name."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), } } - #[doc = "Cancels a Job (asynchronous)."] + #[doc = "Get datastore secrets."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn cancel( + #[doc = "* `name`: Datastore name."] + pub fn list_secrets( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, - ) -> cancel::RequestBuilder { - cancel::RequestBuilder { + name: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), } } } @@ -17639,9 +17297,9 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17686,11 +17344,12 @@ pub mod jobs { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) skip: Option, - pub(crate) job_type: Option, - pub(crate) tag: Option, - pub(crate) list_view_type: Option, - pub(crate) scheduled: Option, - pub(crate) schedule_id: Option, + pub(crate) count: Option, + pub(crate) is_default: Option, + pub(crate) names: Vec, + pub(crate) search_text: Option, + pub(crate) order_by: Option, + pub(crate) order_by_asc: Option, } impl RequestBuilder { #[doc = "Continuation token for pagination."] @@ -17698,32 +17357,37 @@ pub mod jobs { self.skip = Some(skip.into()); self } - #[doc = "Type of job to be returned."] - pub fn job_type(mut self, job_type: impl Into) -> Self { - self.job_type = Some(job_type.into()); + #[doc = "Maximum number of results to return."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); self } - #[doc = "Jobs returned will have this tag key."] - pub fn tag(mut self, tag: impl Into) -> Self { - self.tag = Some(tag.into()); + #[doc = "Filter down to the workspace default datastore."] + pub fn is_default(mut self, is_default: bool) -> Self { + self.is_default = Some(is_default); self } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); + #[doc = "Names of datastores to return."] + pub fn names(mut self, names: Vec) -> Self { + self.names = names; self } - #[doc = "Indicator whether the job is scheduled job."] - pub fn scheduled(mut self, scheduled: bool) -> Self { - self.scheduled = Some(scheduled); + #[doc = "Text to search for in the datastore names."] + pub fn search_text(mut self, search_text: impl Into) -> Self { + self.search_text = Some(search_text.into()); self } - #[doc = "The scheduled id for listing the job triggered from"] - pub fn schedule_id(mut self, schedule_id: impl Into) -> Self { - self.schedule_id = Some(schedule_id.into()); + #[doc = "Order by property (createdtime | modifiedtime | name)."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Order by property in ascending order."] + pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { + self.order_by_asc = Some(order_by_asc); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -17744,7 +17408,7 @@ pub mod jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17761,20 +17425,20 @@ pub mod jobs { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(job_type) = &this.job_type { - req.url_mut().query_pairs_mut().append_pair("jobType", job_type); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); } - if let Some(tag) = &this.tag { - req.url_mut().query_pairs_mut().append_pair("tag", tag); + if let Some(is_default) = &this.is_default { + req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + if let Some(search_text) = &this.search_text { + req.url_mut().query_pairs_mut().append_pair("searchText", search_text); } - if let Some(scheduled) = &this.scheduled { - req.url_mut().query_pairs_mut().append_pair("scheduled", &scheduled.to_string()); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); } - if let Some(schedule_id) = &this.schedule_id { - req.url_mut().query_pairs_mut().append_pair("scheduleId", schedule_id); + if let Some(order_by_asc) = &this.order_by_asc { + req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17795,7 +17459,7 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -17804,7 +17468,7 @@ pub mod jobs { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -17819,9 +17483,9 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17865,7 +17529,7 @@ pub mod jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -17892,24 +17556,24 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17929,9 +17593,9 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DatastoreResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17975,10 +17639,16 @@ pub mod jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::JobBaseResource, + pub(crate) name: String, + pub(crate) body: models::DatastoreResource, + pub(crate) skip_validation: Option, } impl RequestBuilder { + #[doc = "Flag to skip validation."] + pub fn skip_validation(mut self, skip_validation: bool) -> Self { + self.skip_validation = Some(skip_validation); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17995,6 +17665,11 @@ pub mod jobs { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); + if let Some(skip_validation) = &this.skip_validation { + req.url_mut() + .query_pairs_mut() + .append_pair("skipValidation", &skip_validation.to_string()); + } req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -18004,24 +17679,24 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -18047,9 +17722,6 @@ pub mod jobs { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -18061,46 +17733,31 @@ pub mod jobs { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -18127,23 +17784,23 @@ pub mod jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } - pub mod cancel { + pub mod list_secrets { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -18152,15 +17809,17 @@ pub mod jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DatastoreSecretsUnion = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -18172,41 +17831,31 @@ pub mod jobs { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -18233,25 +17882,30 @@ pub mod jobs { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod labeling_jobs { +pub mod environment_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -18259,7 +17913,7 @@ pub mod labeling_jobs { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists labeling jobs in the workspace."] + #[doc = "List environment containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -18277,147 +17931,76 @@ pub mod labeling_jobs { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), skip: None, - top: None, + list_view_type: None, } } - #[doc = "Gets a labeling job by name/id."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), - include_job_instructions: None, - include_label_categories: None, + name: name.into(), } } - #[doc = "Creates or updates a labeling job (asynchronous)."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: LabelingJob definition object."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, - body: impl Into, + name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), body: body.into(), } } - #[doc = "Delete a labeling job."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] + #[doc = "* `name`: Container name. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - id: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Export labels from a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: The export summary."] - pub fn export_labels( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> export_labels::RequestBuilder { - export_labels::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Pause a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn pause( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> pause::RequestBuilder { - pause::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Resume a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn resume( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), + name: name.into(), } } } @@ -18430,9 +18013,9 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18477,7 +18060,7 @@ pub mod labeling_jobs { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) skip: Option, - pub(crate) top: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { #[doc = "Continuation token for pagination."] @@ -18485,12 +18068,14 @@ pub mod labeling_jobs { self.skip = Some(skip.into()); self } - #[doc = "Number of labeling jobs to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream( + self, + ) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -18511,7 +18096,7 @@ pub mod labeling_jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -18528,8 +18113,8 @@ pub mod labeling_jobs { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -18550,7 +18135,7 @@ pub mod labeling_jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -18559,7 +18144,7 @@ pub mod labeling_jobs { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -18574,9 +18159,9 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18620,21 +18205,9 @@ pub mod labeling_jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) include_job_instructions: Option, - pub(crate) include_label_categories: Option, + pub(crate) name: String, } impl RequestBuilder { - #[doc = "Boolean value to indicate whether to include JobInstructions in response."] - pub fn include_job_instructions(mut self, include_job_instructions: bool) -> Self { - self.include_job_instructions = Some(include_job_instructions); - self - } - #[doc = "Boolean value to indicate Whether to include LabelCategories in response."] - pub fn include_label_categories(mut self, include_label_categories: bool) -> Self { - self.include_label_categories = Some(include_label_categories); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -18651,16 +18224,6 @@ pub mod labeling_jobs { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(include_job_instructions) = &this.include_job_instructions { - req.url_mut() - .query_pairs_mut() - .append_pair("includeJobInstructions", &include_job_instructions.to_string()); - } - if let Some(include_label_categories) = &this.include_label_categories { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLabelCategories", &include_label_categories.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18669,24 +18232,24 @@ pub mod labeling_jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -18706,9 +18269,9 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = serde_json::from_slice(&bytes)?; + let body: models::EnvironmentContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18717,9 +18280,6 @@ pub mod labeling_jobs { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -18731,44 +18291,32 @@ pub mod labeling_jobs { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::LabelingJobResource, + pub(crate) name: String, + pub(crate) body: models::EnvironmentContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -18796,59 +18344,31 @@ pub mod labeling_jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + Box::pin(async move { self.send().await?.into_body().await }) } } } @@ -18902,7 +18422,7 @@ pub mod labeling_jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -18929,204 +18449,137 @@ pub mod labeling_jobs { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.id + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } - pub mod export_labels { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExportSummaryUnion = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() +} +pub mod environment_versions { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List versions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + order_by: None, + top: None, + skip: None, + list_view_type: None, } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + #[doc = "Get version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::ExportSummaryUnion, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/exportLabels" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) + #[doc = "Creates or updates an EnvironmentVersion."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] + #[doc = "* `version`: Version of EnvironmentVersion."] + #[doc = "* `body`: Definition of EnvironmentVersion."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), + body: body.into(), } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) + #[doc = "Delete version."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + version: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + version: version.into(), } } } - pub mod pause { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19135,6 +18588,11 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + Ok(body) + } pub fn into_raw_response(self) -> azure_core::Response { self.0 } @@ -19176,19 +18634,179 @@ pub mod labeling_jobs { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream( + self, + ) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2023-04-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()), + ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentVersionResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -19196,31 +18814,35 @@ pub mod labeling_jobs { format!("Bearer {}", token_response.token.secret()), ); 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?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/pause", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod resume { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19229,15 +18851,17 @@ pub mod labeling_jobs { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentVersionResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -19249,41 +18873,33 @@ pub mod labeling_jobs { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) id: String, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::EnvironmentVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19295,45 +18911,144 @@ pub mod labeling_jobs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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()), ); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/resume" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } -} -pub mod model_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) version: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } +} +pub mod jobs { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists Jobs in the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] pub fn list( &self, @@ -19347,77 +19062,100 @@ pub mod model_containers { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), skip: None, - count: None, + job_type: None, + tag: None, list_view_type: None, } } - #[doc = "Get container."] + #[doc = "Gets a Job by name/id."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, + id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + id: id.into(), } } - #[doc = "Create or update container."] + #[doc = "Creates and executes a Job."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + #[doc = "* `body`: Job definition object."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - body: impl Into, + id: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + id: id.into(), body: body.into(), } } - #[doc = "Delete container."] + #[doc = "Deletes a Job (asynchronous)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, + id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + id: id.into(), + } + } + #[doc = "Cancels a Job (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] + pub fn cancel( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + id: impl Into, + ) -> cancel::RequestBuilder { + cancel::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + id: id.into(), } } } @@ -19430,9 +19168,9 @@ pub mod model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19477,7 +19215,8 @@ pub mod model_containers { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) skip: Option, - pub(crate) count: Option, + pub(crate) job_type: Option, + pub(crate) tag: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { @@ -19486,9 +19225,14 @@ pub mod model_containers { self.skip = Some(skip.into()); self } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); + #[doc = "Type of job to be returned."] + pub fn job_type(mut self, job_type: impl Into) -> Self { + self.job_type = Some(job_type.into()); + self + } + #[doc = "Jobs returned will have this tag key."] + pub fn tag(mut self, tag: impl Into) -> Self { + self.tag = Some(tag.into()); self } #[doc = "View type for including/excluding (for example) archived entities."] @@ -19496,7 +19240,7 @@ pub mod model_containers { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -19517,7 +19261,7 @@ pub mod model_containers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -19534,8 +19278,11 @@ pub mod model_containers { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + if let Some(job_type) = &this.job_type { + req.url_mut().query_pairs_mut().append_pair("jobType", job_type); + } + if let Some(tag) = &this.tag { + req.url_mut().query_pairs_mut().append_pair("tag", tag); } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); @@ -19559,7 +19306,7 @@ pub mod model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -19568,7 +19315,7 @@ pub mod model_containers { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -19583,9 +19330,9 @@ pub mod model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19629,7 +19376,7 @@ pub mod model_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19656,24 +19403,24 @@ pub mod model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -19693,9 +19440,9 @@ pub mod model_containers { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; + let body: models::JobBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19739,8 +19486,8 @@ pub mod model_containers { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ModelContainerResource, + pub(crate) id: String, + pub(crate) body: models::JobBaseResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19768,24 +19515,24 @@ pub mod model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -19811,6 +19558,9 @@ pub mod model_containers { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -19822,31 +19572,46 @@ pub mod model_containers { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -19873,24 +19638,131 @@ pub mod model_containers { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name + &self.id ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } + pub mod cancel { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod model_versions { +pub mod model_containers { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -19898,53 +19770,41 @@ pub mod model_versions { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List model versions."] + #[doc = "List model containers."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Model name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), skip: None, - order_by: None, - top: None, - version: None, - description: None, - offset: None, - tags: None, - properties: None, - feed: None, + count: None, list_view_type: None, } } - #[doc = "Get version."] + #[doc = "Get container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), @@ -19952,26 +19812,23 @@ pub mod model_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } - #[doc = "Create or update version."] + #[doc = "Create or update container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] + #[doc = "* `body`: Container entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, - body: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), @@ -19979,25 +19836,22 @@ pub mod model_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), body: body.into(), } } - #[doc = "Delete version."] + #[doc = "Delete container."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, name: impl Into, - version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), @@ -20005,7 +19859,6 @@ pub mod model_versions { resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), name: name.into(), - version: version.into(), } } } @@ -20018,9 +19871,9 @@ pub mod model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20064,16 +19917,8 @@ pub mod model_versions { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) offset: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) feed: Option, + pub(crate) count: Option, pub(crate) list_view_type: Option, } impl RequestBuilder { @@ -20082,44 +19927,9 @@ pub mod model_versions { self.skip = Some(skip.into()); self } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Model version."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Number of initial results to skip."] - pub fn offset(mut self, offset: i32) -> Self { - self.offset = Some(offset); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "Name of the feed."] - pub fn feed(mut self, feed: impl Into) -> Self { - self.feed = Some(feed.into()); + #[doc = "Maximum number of results to return."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); self } #[doc = "View type for including/excluding (for example) archived entities."] @@ -20127,7 +19937,7 @@ pub mod model_versions { self.list_view_type = Some(list_view_type.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -20148,7 +19958,7 @@ pub mod model_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -20165,29 +19975,8 @@ pub mod model_versions { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(offset) = &this.offset { - req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(feed) = &this.feed { - req.url_mut().query_pairs_mut().append_pair("feed", feed); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); } if let Some(list_view_type) = &this.list_view_type { req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); @@ -20211,17 +20000,16 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name, - &self.name + &self.workspace_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -20236,9 +20024,9 @@ pub mod model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20283,7 +20071,6 @@ pub mod model_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20310,25 +20097,24 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -20348,9 +20134,9 @@ pub mod model_versions { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; + let body: models::ModelContainerResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20395,8 +20181,7 @@ pub mod model_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, + pub(crate) body: models::ModelContainerResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20424,25 +20209,24 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -20504,7 +20288,6 @@ pub mod model_versions { pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) name: String, - pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20531,25 +20314,24 @@ pub mod model_versions { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.name, - &self.version + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod online_endpoints { +pub mod model_versions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -20557,193 +20339,114 @@ pub mod online_endpoints { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List Online Endpoints."] + #[doc = "List model versions."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Model name. This is case-sensitive."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, + name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: None, - count: None, - compute_type: None, + name: name.into(), skip: None, + order_by: None, + top: None, + version: None, + description: None, + offset: None, tags: None, properties: None, - order_by: None, + feed: None, + list_view_type: None, } } - #[doc = "Get Online Endpoint."] + #[doc = "Get version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + name: impl Into, + version: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), + version: version.into(), } } - #[doc = "Create or update Online Endpoint (asynchronous)."] + #[doc = "Create or update version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] + #[doc = "* `body`: Version entity to create or update."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, + name: impl Into, + version: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), + version: version.into(), body: body.into(), } } - #[doc = "Delete Online Endpoint (asynchronous)."] + #[doc = "Delete version."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `name`: Container name. This is case-sensitive."] + #[doc = "* `version`: Version identifier. This is case-sensitive."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - endpoint_name: impl Into, + name: impl Into, + version: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: RegenerateKeys request ."] - pub fn regenerate_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> regenerate_keys::RequestBuilder { - regenerate_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn get_token( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get_token::RequestBuilder { - get_token::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), + name: name.into(), + version: version.into(), } } } @@ -20756,9 +20459,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20802,53 +20505,70 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: Option, - pub(crate) count: Option, - pub(crate) compute_type: Option, + pub(crate) name: String, pub(crate) skip: Option, + pub(crate) order_by: Option, + pub(crate) top: Option, + pub(crate) version: Option, + pub(crate) description: Option, + pub(crate) offset: Option, pub(crate) tags: Option, pub(crate) properties: Option, - pub(crate) order_by: Option, + pub(crate) feed: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Name of the endpoint."] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); self } - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); self } - #[doc = "EndpointComputeType to be filtered by."] - pub fn compute_type(mut self, compute_type: impl Into) -> Self { - self.compute_type = Some(compute_type.into()); + #[doc = "Maximum number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); self } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); + #[doc = "Model version."] + pub fn version(mut self, version: impl Into) -> Self { + self.version = Some(version.into()); self } - #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] + #[doc = "Model description."] + pub fn description(mut self, description: impl Into) -> Self { + self.description = Some(description.into()); + self + } + #[doc = "Number of initial results to skip."] + pub fn offset(mut self, offset: i32) -> Self { + self.offset = Some(offset); + self + } + #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] pub fn tags(mut self, tags: impl Into) -> Self { self.tags = Some(tags.into()); self } - #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] + #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] pub fn properties(mut self, properties: impl Into) -> Self { self.properties = Some(properties.into()); self } - #[doc = "The option to order the response."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); + #[doc = "Name of the feed."] + pub fn feed(mut self, feed: impl Into) -> Self { + self.feed = Some(feed.into()); self } - pub fn into_stream( - self, - ) -> azure_core::Pageable { + #[doc = "View type for including/excluding (for example) archived entities."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { @@ -20869,7 +20589,7 @@ pub mod online_endpoints { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -20883,17 +20603,23 @@ pub mod online_endpoints { azure_core::headers::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()), ); - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); } - if let Some(compute_type) = &this.compute_type { - req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); + if let Some(version) = &this.version { + req.url_mut().query_pairs_mut().append_pair("version", version); + } + if let Some(description) = &this.description { + req.url_mut().query_pairs_mut().append_pair("description", description); + } + if let Some(offset) = &this.offset { + req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); } if let Some(tags) = &this.tags { req.url_mut().query_pairs_mut().append_pair("tags", tags); @@ -20901,8 +20627,11 @@ pub mod online_endpoints { if let Some(properties) = &this.properties { req.url_mut().query_pairs_mut().append_pair("properties", properties); } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + if let Some(feed) = &this.feed { + req.url_mut().query_pairs_mut().append_pair("feed", feed); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -20923,16 +20652,17 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, - &self.workspace_name + &self.workspace_name, + &self.name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -20947,9 +20677,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20993,7 +20723,8 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21020,24 +20751,25 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -21057,9 +20789,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ModelVersionResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21068,9 +20800,6 @@ pub mod online_endpoints { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21082,44 +20811,33 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::OnlineEndpointTrackedResource, + pub(crate) name: String, + pub(crate) version: String, + pub(crate) body: models::ModelVersionResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21147,63 +20865,36 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21212,20 +20903,12 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21237,47 +20920,32 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, + pub(crate) name: String, + pub(crate) version: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21289,15 +20957,14 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -21305,174 +20972,223 @@ pub mod online_endpoints { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, &self.workspace_name, - &self.endpoint_name + &self.name, + &self.version ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) +} +pub mod online_endpoints { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List Online Endpoints."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: None, + count: None, + compute_type: None, + skip: None, + tags: None, + properties: None, + order_by: None, } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Get Online Endpoint."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Create or update Online Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + #[doc = "Update Online Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + #[doc = "Delete Online Endpoint (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn list_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + } } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `body`: RegenerateKeys request ."] + pub fn regenerate_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + body: impl Into, + ) -> regenerate_keys::RequestBuilder { + regenerate_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + body: body.into(), } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) + } + #[doc = "Retrieve a valid AML token for an Endpoint using AMLToken-based authentication."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + pub fn get_token( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> get_token::RequestBuilder { + get_token::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), } } } - pub mod list_keys { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21481,9 +21197,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21527,56 +21243,143 @@ pub mod online_endpoints { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, + pub(crate) name: Option, + pub(crate) count: Option, + pub(crate) compute_type: Option, + pub(crate) skip: Option, + pub(crate) tags: Option, + pub(crate) properties: Option, + pub(crate) order_by: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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 = "Name of the endpoint."] + pub fn name(mut self, name: impl Into) -> Self { + self.name = Some(name.into()); + self + } + #[doc = "Number of endpoints to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } + #[doc = "EndpointComputeType to be filtered by."] + pub fn compute_type(mut self, compute_type: impl Into) -> Self { + self.compute_type = Some(compute_type.into()); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] + pub fn properties(mut self, properties: impl Into) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "The option to order the response."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + pub fn into_stream( + self, + ) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2023-04-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()), + ); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } + if let Some(compute_type) = &this.compute_type { + req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(properties) = &this.properties { + req.url_mut().query_pairs_mut().append_pair("properties", properties); + } + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); + } + 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) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod regenerate_keys { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21585,15 +21388,17 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineEndpointTrackedResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21605,42 +21410,31 @@ pub mod online_endpoints { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) body: models::RegenerateEndpointKeysRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21652,32 +21446,50 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_token { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21686,9 +21498,9 @@ pub mod online_endpoints { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthToken = serde_json::from_slice(&bytes)?; + let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21697,6 +21509,9 @@ pub mod online_endpoints { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21708,31 +21523,47 @@ pub mod online_endpoints { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This [`RequestBuilder`] implements a request that returns an"] + #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] + #[doc = r" implementation does not support polling the status of the"] + #[doc = r" operation, however future versions of this crate may include"] + #[doc = r" this support."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" executes the request. Future versions may poll the service"] + #[doc = r" until the operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, + pub(crate) body: models::OnlineEndpointTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -21744,35 +21575,44 @@ pub mod online_endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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()), ); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] + #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -21781,203 +21621,1161 @@ pub mod online_endpoints { } } } -} -pub mod online_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Inference Endpoint Deployments."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, + pub mod update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineEndpointTrackedResource = serde_json::from_slice(&bytes)?; + Ok(body) } - } - #[doc = "Get Inference Deployment Deployment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), + pub fn into_raw_response(self) -> azure_core::Response { + self.0 } - } - #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Inference Endpoint entity to apply during operation."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) } } - #[doc = "Update Online Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - #[doc = "Retrieve online deployment logs."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: The name and identifier for the endpoint."] - #[doc = "* `body`: The request containing parameters for retrieving logs."] - pub fn get_logs( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> get_logs::RequestBuilder { - get_logs::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) } } - #[doc = "List Inference Endpoint Deployment Skus."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn list_skus( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> list_skus::RequestBuilder { - list_skus::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - count: None, - skip: None, + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.endpoint_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } + pub mod list_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EndpointAuthKeys = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod regenerate_keys { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) body: models::RegenerateEndpointKeysRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } + pub mod get_token { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EndpointAuthToken = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + 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?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod online_deployments { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List Inference Endpoint Deployments."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + order_by: None, + top: None, + skip: None, + } + } + #[doc = "Get Inference Deployment Deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + } + } + #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `body`: Inference Endpoint entity to apply during operation."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), + } + } + #[doc = "Update Online Deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Online Endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + #[doc = "* `body`: Online Endpoint entity to apply during operation."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), + } + } + #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + } + } + #[doc = "Polls an Endpoint operation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: The name and identifier for the endpoint."] + #[doc = "* `body`: The request containing parameters for retrieving logs."] + pub fn get_logs( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + body: impl Into, + ) -> get_logs::RequestBuilder { + get_logs::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + body: body.into(), + } + } + #[doc = "List Inference Endpoint Deployment Skus."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `endpoint_name`: Inference endpoint name."] + #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] + pub fn list_skus( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + endpoint_name: impl Into, + deployment_name: impl Into, + ) -> list_skus::RequestBuilder { + list_skus::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + endpoint_name: endpoint_name.into(), + deployment_name: deployment_name.into(), + count: None, + skip: None, + } + } + } + pub mod list { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) order_by: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Ordering of list."] + pub fn order_by(mut self, order_by: impl Into) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "Top of list."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream( + self, + ) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = this.url()?; + 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, "2023-04-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()), + ); + if let Some(order_by) = &this.order_by { + req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + } + pub mod get { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineDeploymentTrackedResource = 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 for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OnlineDeploymentTrackedResource = 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 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This [`RequestBuilder`] implements a request that returns an"] + #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] + #[doc = r" implementation does not support polling the status of the"] + #[doc = r" operation, however future versions of this crate may include"] + #[doc = r" this support."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request. Future versions may poll the service"] + #[doc = r" until the operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + pub(crate) body: models::OnlineDeploymentTrackedResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -21986,9 +22784,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21997,6 +22795,9 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -22008,126 +22809,230 @@ pub mod online_deployments { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) deployment_name: String, + pub(crate) body: models::PartialMinimalTrackedResourceWithSku, } impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2022-12-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, + sleep::sleep, + }; + use std::time::Duration; + loop { + let this = self.clone(); + let response = this.send().await?; + let retry_after = get_retry_after(response.as_raw_response().headers()); + let status = response.as_raw_response().status(); + let body = response.into_body().await?; + let provisioning_state = get_provisioning_state(status, &body)?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => return Ok(body), + LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? + _ => { + sleep(retry_after).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 + } + } + }) + } + } + } + pub mod delete { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + #[derive(Debug)] + pub struct Response(azure_core::Response); + impl Response { + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] + #[doc = r" To finalize and submit the request, invoke `.await`, which"] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] + #[doc = r""] + #[doc = r" In order to execute the request without polling the service"] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) endpoint_name: String, + pub(crate) deployment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } - pub mod get { + pub mod get_logs { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22136,9 +23041,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::DeploymentLogs = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22184,6 +23089,7 @@ pub mod online_deployments { pub(crate) workspace_name: String, pub(crate) endpoint_name: String, pub(crate) deployment_name: String, + pub(crate) body: models::DeploymentLogsRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22195,32 +23101,33 @@ pub mod online_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -22231,7 +23138,7 @@ pub mod online_deployments { } } } - pub mod create_or_update { + pub mod list_skus { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22240,9 +23147,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::SkuResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22251,9 +23158,6 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -22265,37 +23169,25 @@ pub mod online_deployments { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, @@ -22303,84 +23195,190 @@ pub mod online_deployments { pub(crate) workspace_name: String, pub(crate) endpoint_name: String, pub(crate) deployment_name: String, - pub(crate) body: models::OnlineDeploymentTrackedResource, + pub(crate) count: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Number of Skus to be retrieved in a page of results."] + pub fn count(mut self, count: i32) -> Self { + self.count = Some(count); + self + } + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2023-04-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()), + ); + if let Some(count) = &this.count { + req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + 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) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + } +} +pub mod schedules { + use super::models; + #[cfg(not(target_arch = "wasm32"))] + use futures::future::BoxFuture; + #[cfg(target_arch = "wasm32")] + use futures::future::LocalBoxFuture as BoxFuture; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List schedules in specified workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + skip: None, + list_view_type: None, + } + } + #[doc = "Get schedule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Schedule name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + } + } + #[doc = "Create or update schedule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Schedule name."] + #[doc = "* `body`: Schedule definition."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + body: body.into(), + } + } + #[doc = "Delete schedule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] + #[doc = "* `name`: Schedule name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), } } } - pub mod update { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22389,9 +23387,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = serde_json::from_slice(&bytes)?; + let body: models::ScheduleResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22400,9 +23398,6 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -22414,125 +23409,120 @@ pub mod online_deployments { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithSku, + pub(crate) skip: Option, + pub(crate) list_view_type: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Continuation token for pagination."] + pub fn skip(mut self, skip: impl Into) -> Self { + self.skip = Some(skip.into()); + self + } + #[doc = "Status filter for schedule."] + pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { + self.list_view_type = Some(list_view_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2023-04-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()), + ); + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", skip); + } + if let Some(list_view_type) = &this.list_view_type { + req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); + } + 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) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) } } } - pub mod delete { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22541,15 +23531,17 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScheduleResource = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -22561,47 +23553,31 @@ pub mod online_deployments { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22613,7 +23589,7 @@ pub mod online_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + 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( @@ -22627,17 +23603,36 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_logs { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22646,9 +23641,9 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentLogs = serde_json::from_slice(&bytes)?; + let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22657,6 +23652,9 @@ pub mod online_deployments { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -22668,33 +23666,47 @@ pub mod online_deployments { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This [`RequestBuilder`] implements a request that returns an"] + #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] + #[doc = r" implementation does not support polling the status of the"] + #[doc = r" operation, however future versions of this crate may include"] + #[doc = r" this support."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" executes the request. Future versions may poll the service"] + #[doc = r" until the operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::DeploymentLogsRequest, + pub(crate) name: String, + pub(crate) body: models::ScheduleResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -22706,7 +23718,7 @@ pub mod online_deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + 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( @@ -22721,20 +23733,29 @@ pub mod online_deployments { }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] + #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] + #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] @@ -22743,7 +23764,7 @@ pub mod online_deployments { } } } - pub mod list_skus { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22752,17 +23773,15 @@ pub mod online_deployments { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SkuResourceArmPaginatedResult = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -22774,117 +23793,90 @@ pub mod online_deployments { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, + pub(crate) name: String, } impl RequestBuilder { - #[doc = "Number of Skus to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-12-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = this.url()?; + 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()), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.workspace_name, + &self.name + ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } } -pub mod schedules { +pub mod registries { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -22892,242 +23884,134 @@ pub mod schedules { use futures::future::LocalBoxFuture as BoxFuture; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List schedules in specified workspace."] + #[doc = "List registries by subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List registries"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { + pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, } } - #[doc = "Get schedule."] + #[doc = "Get registry"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, + registry_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), + registry_name: registry_name.into(), } } - #[doc = "Create or update schedule."] + #[doc = "Create or update registry"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - #[doc = "* `body`: Schedule definition."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `body`: Details required to create the registry."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, + registry_name: impl Into, + body: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), + registry_name: registry_name.into(), body: body.into(), } } - #[doc = "Delete schedule."] + #[doc = "Update tags"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `body`: Details required to create the registry."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + body: body.into(), + } + } + #[doc = "Delete registry"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, + registry_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + registry_name: registry_name.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Status filter for schedule."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2022-12-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) + #[doc = "Remove regions from registry"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] + #[doc = "* `body`: Details required to create the registry."] + pub fn remove_regions( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + registry_name: impl Into, + body: impl Into, + ) -> remove_regions::RequestBuilder { + remove_regions::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + registry_name: registry_name.into(), + body: body.into(), } } } - pub mod get { + pub mod list_by_subscription { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23136,9 +24020,9 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = serde_json::from_slice(&bytes)?; + let body: models::RegistryTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23180,219 +24064,76 @@ pub mod schedules { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ScheduleResource, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2023-04-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()), + ); + 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) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", + "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/registries", self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name + &self.subscription_id ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) } } } - pub mod delete { + pub mod list { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23401,15 +24142,17 @@ pub mod schedules { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegistryTrackedResourceArmPaginatedResult = 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 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -23421,205 +24164,100 @@ pub mod schedules { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] + #[doc = r" which will convert the [`RequestBuilder`] into a future"] + #[doc = r" executes the request and returns a `Result` with the parsed"] + #[doc = r" response."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] + #[doc = r" until the operation completes, use `.send().await` instead."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details"] + #[doc = r" (e.g. to inspect response headers or raw body data) then you"] + #[doc = r" can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future"] + #[doc = r" that resolves to a lower-level [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = this.url()?; + 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, "2023-04-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()), + ); + 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) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries", self.client.endpoint(), &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name + &self.resource_group_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } } -} -pub mod registries { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List registries by subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - skip: None, - } - } - #[doc = "List registries"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - skip: None, - } - } - #[doc = "Get registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - } - } - #[doc = "Create or update registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - #[doc = "Update tags"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - #[doc = "Delete registry."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of registry. This is case-insensitive"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - } - } - } - pub mod list_by_subscription { + pub mod get { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23628,9 +24266,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::RegistryTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23672,85 +24310,62 @@ pub mod registries { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) skip: Option, + pub(crate) resource_group_name: String, + pub(crate) registry_name: String, } impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2022-12-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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 + let url = this.url()?; + 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 req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/registries", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", self.client.endpoint(), - &self.subscription_id + &self.subscription_id, + &self.resource_group_name, + &self.registry_name ))?; let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod list { + pub mod create_or_update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23759,9 +24374,9 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = serde_json::from_slice(&bytes)?; + let body: models::RegistryTrackedResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23787,103 +24402,142 @@ pub mod registries { #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] + #[doc = r" This `RequestBuilder` implements a Long Running Operation"] + #[doc = r" (LRO)."] + #[doc = r""] #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] + #[doc = r" which will convert the `RequestBuilder` into a future"] + #[doc = r" executes the request and polls the service until the"] + #[doc = r" operation completes."] #[doc = r""] #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] + #[doc = r" until the operation completes, use"] + #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] + #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) skip: Option, + pub(crate) registry_name: String, + pub(crate) body: models::RegistryTrackedResource, } impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = this.url()?; - 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, "2022-12-01-preview"); + let url = this.url()?; + 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.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", + self.client.endpoint(), + &self.subscription_id, + &self.resource_group_name, + &self.registry_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + Ok(url) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] + #[doc = ""] + #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + use azure_core::{ + error::{Error, ErrorKind}, + lro::{ + get_retry_after, + location::{get_location, get_provisioning_state, FinalState}, + LroStatus, + }, + sleep::sleep, + }; + use std::time::Duration; + let this = self.clone(); + let response = this.send().await?; + let headers = response.as_raw_response().headers(); + let location = get_location(headers, FinalState::AzureAsyncOperation)?; + if let Some(url) = location { + loop { + let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); + let credential = self.client.token_credential(); + let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let response = self.client.send(&mut req).await?; + let headers = response.headers(); + let retry_after = get_retry_after(headers); + let bytes = response.into_body().collect().await?; + let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { + Error::message( + ErrorKind::Other, + "Long running operation failed (missing provisioning state)".to_string(), + ) + })?; + log::trace!("current provisioning_state: {provisioning_state:?}"); + match provisioning_state { + LroStatus::Succeeded => { + let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); + let credential = self.client.token_credential(); + let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let response = self.client.send(&mut req).await?; + return Response(response).into_body().await; } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); + LroStatus::Failed => { + return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) } - 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 + LroStatus::Canceled => { + return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) + } + _ => { + sleep(retry_after).await; + } + } + } + } else { + response.into_body().await } - }; - azure_core::Pageable::new(make_request) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) + }) } } } - pub mod get { + pub mod update { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -23938,6 +24592,7 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, + pub(crate) body: models::PartialRegistryPartialTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -23949,14 +24604,15 @@ pub mod registries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + 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()), ); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -23973,7 +24629,7 @@ pub mod registries { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -23991,7 +24647,7 @@ pub mod registries { } } } - pub mod create_or_update { + pub mod delete { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -24000,17 +24656,15 @@ pub mod registries { #[derive(Debug)] pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -24022,6 +24676,22 @@ pub mod registries { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } + #[doc = "URI to poll for asynchronous operation result."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "Duration the client should wait between requests, in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -24045,7 +24715,6 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) body: models::RegistryTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -24057,15 +24726,14 @@ pub mod registries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -24082,88 +24750,13 @@ pub mod registries { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::AzureAsyncOperation)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } } - pub mod update { + pub mod remove_regions { use super::models; #[cfg(not(target_arch = "wasm32"))] use futures::future::BoxFuture; @@ -24199,6 +24792,11 @@ pub mod registries { } pub struct Headers<'a>(&'a azure_core::headers::Headers); impl<'a> Headers<'a> { + #[doc = "Timeout for the client to use when polling the asynchronous operation."] + pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) + } #[doc = "URI to poll for asynchronous operation result."] pub fn location(&self) -> azure_core::Result<&str> { self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) @@ -24231,7 +24829,7 @@ pub mod registries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) registry_name: String, - pub(crate) body: models::PartialRegistryPartialTrackedResource, + pub(crate) body: models::RegistryTrackedResource, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -24243,7 +24841,7 @@ pub mod registries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + 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( @@ -24259,7 +24857,7 @@ pub mod registries { } fn url(&self) -> azure_core::Result { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/removeRegions", self.client.endpoint(), &self.subscription_id, &self.resource_group_name, @@ -24268,7 +24866,7 @@ pub mod registries { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } @@ -24349,115 +24947,6 @@ pub mod registries { } } } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); - } - Ok(url) - } - } - } } pub mod workspace_features { use super::models; @@ -24565,7 +25054,7 @@ pub mod workspace_features { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -24607,7 +25096,7 @@ pub mod workspace_features { let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); if !has_api_version_already { url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } Ok(url) } diff --git a/services/mgmt/machinelearningservices/src/package_preview_2022_10/models.rs b/services/mgmt/machinelearningservices/src/package_2023_04/models.rs similarity index 90% rename from services/mgmt/machinelearningservices/src/package_preview_2022_10/models.rs rename to services/mgmt/machinelearningservices/src/package_2023_04/models.rs index fec54d364e..6929ee89ec 100644 --- a/services/mgmt/machinelearningservices/src/package_preview_2022_10/models.rs +++ b/services/mgmt/machinelearningservices/src/package_2023_04/models.rs @@ -163,21 +163,6 @@ pub mod aks_schema { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccessKeyAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl AccessKeyAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} #[doc = "Account key datastore credentials configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccountKeyDatastoreCredentials { @@ -651,7 +636,7 @@ impl AmlComputeSchema { Self::default() } } -#[doc = "Azure Machine Learning REST API operation"] +#[doc = "Azure Machine Learning workspace REST API operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AmlOperation { #[doc = "Operation name: {provider}/{resource}/{operation}"] @@ -696,7 +681,7 @@ pub mod aml_operation { #[doc = "An array of operations supported by the resource provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AmlOperationListResult { - #[doc = "List of AML operations supported by the AML resource provider."] + #[doc = "List of AML workspace operations supported by the AML workspace resource provider."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -1006,6 +991,43 @@ impl AutoPauseProperties { Self::default() } } +#[doc = "AutoRebuild setting for the derived image"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "AutoRebuildSetting")] +pub enum AutoRebuildSetting { + Disabled, + OnBaseImageUpdate, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for AutoRebuildSetting { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for AutoRebuildSetting { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for AutoRebuildSetting { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("AutoRebuildSetting", 0u32, "Disabled"), + Self::OnBaseImageUpdate => serializer.serialize_unit_variant("AutoRebuildSetting", 1u32, "OnBaseImageUpdate"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Auto scale properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoScaleProperties { @@ -1054,23 +1076,9 @@ impl AutoTargetRollingWindowSize { } } } -#[doc = "Settings for Autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutologgerSettings { - #[doc = "Enum to determine the state of mlflow autologger."] - #[serde(rename = "mlflowAutologger")] - pub mlflow_autologger: MlFlowAutologgerState, -} -impl AutologgerSettings { - pub fn new(mlflow_autologger: MlFlowAutologgerState) -> Self { - Self { mlflow_autologger } - } -} #[doc = "Azure Blob datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureBlobDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "Storage account name."] @@ -1091,7 +1099,6 @@ pub struct AzureBlobDatastore { impl AzureBlobDatastore { pub fn new(datastore: Datastore) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name: None, container_name: None, @@ -1104,8 +1111,6 @@ impl AzureBlobDatastore { #[doc = "Azure Data Lake Gen1 datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureDataLakeGen1Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] @@ -1117,7 +1122,6 @@ pub struct AzureDataLakeGen1Datastore { impl AzureDataLakeGen1Datastore { pub fn new(datastore: Datastore, store_name: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, service_data_access_auth_identity: None, store_name, @@ -1127,8 +1131,6 @@ impl AzureDataLakeGen1Datastore { #[doc = "Azure Data Lake Gen2 datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureDataLakeGen2Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "[Required] Storage account name."] @@ -1148,7 +1150,6 @@ pub struct AzureDataLakeGen2Datastore { impl AzureDataLakeGen2Datastore { pub fn new(datastore: Datastore, account_name: String, filesystem: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name, endpoint: None, @@ -1158,26 +1159,9 @@ impl AzureDataLakeGen2Datastore { } } } -#[doc = "Base definition for Azure datastore contents configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureDatastore { - #[doc = "Azure Resource Group name"] - #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] - pub resource_group: Option, - #[doc = "Azure Subscription Id"] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, -} -impl AzureDatastore { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Azure File datastore configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureFileDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, #[serde(flatten)] pub datastore: Datastore, #[doc = "[Required] Storage account name."] @@ -1198,7 +1182,6 @@ pub struct AzureFileDatastore { impl AzureFileDatastore { pub fn new(datastore: Datastore, account_name: String, file_share_name: String) -> Self { Self { - azure_datastore: AzureDatastore::default(), datastore, account_name, endpoint: None, @@ -1511,6 +1494,7 @@ impl BayesianSamplingAlgorithm { Self { sampling_algorithm } } } +#[doc = "Describes the bind options for the container"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BindOptions { #[doc = "Type of Bind Option"] @@ -1528,6 +1512,22 @@ impl BindOptions { Self::default() } } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BlobReferenceForConsumptionDto { + #[doc = "Blob URI path for client to upload data.\r\nExample: https://blob.windows.core.net/Container/Path"] + #[serde(rename = "blobUri", default, skip_serializing_if = "Option::is_none")] + pub blob_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credential: Option, + #[doc = "Arm ID of the storage account to use"] + #[serde(rename = "storageAccountArmId", default, skip_serializing_if = "Option::is_none")] + pub storage_account_arm_id: Option, +} +impl BlobReferenceForConsumptionDto { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Enum for all classification models supported by AutoML."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "BlockedTransformers")] @@ -1900,26 +1900,6 @@ impl ClusterUpdateProperties { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CocoExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CocoExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} #[doc = "Configuration for a scoring code asset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CodeConfiguration { @@ -2075,9 +2055,6 @@ impl ColumnTransformer { pub struct CommandJob { #[serde(flatten)] pub job_base: JobBase, - #[doc = "Settings for Autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, #[doc = "ARM resource ID of the code asset."] #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] pub code_id: Option, @@ -2111,7 +2088,6 @@ impl CommandJob { pub fn new(job_base: JobBase, command: String, environment_id: String) -> Self { Self { job_base, - autologger_settings: None, code_id: None, command, distribution: None, @@ -2401,58 +2377,6 @@ impl ComputeInstanceApplication { Self::default() } } -#[doc = "Specifies settings for autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceAutologgerSettings { - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[serde(rename = "mlflowAutologger", default, skip_serializing_if = "Option::is_none")] - pub mlflow_autologger: Option, -} -impl ComputeInstanceAutologgerSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_autologger_settings { - use super::*; - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MlflowAutologger")] - pub enum MlflowAutologger { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MlflowAutologger { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MlflowAutologger { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MlflowAutologger { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlflowAutologger", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlflowAutologger", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ComputeInstanceConnectivityEndpoints { @@ -3048,9 +2972,6 @@ pub struct ComputeInstanceProperties { #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] #[serde(rename = "applicationSharingPolicy", default, skip_serializing_if = "Option::is_none")] pub application_sharing_policy: Option, - #[doc = "Specifies settings for autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, #[doc = "Specifies policy and settings for SSH access."] #[serde(rename = "sshSettings", default, skip_serializing_if = "Option::is_none")] pub ssh_settings: Option, @@ -3103,9 +3024,6 @@ pub struct ComputeInstanceProperties { #[doc = "The list of schedules to be applied on the computes"] #[serde(default, skip_serializing_if = "Option::is_none")] pub schedules: Option, - #[doc = "Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] pub enable_node_public_ip: Option, @@ -3380,7 +3298,7 @@ impl ComputeInstanceVersion { Self::default() } } -#[doc = "[Required] The compute power action."] +#[doc = "The compute power action."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ComputePowerAction")] pub enum ComputePowerAction { @@ -3502,7 +3420,7 @@ pub struct ComputeStartStopSchedule { #[doc = "Is the schedule enabled or disabled?"] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, - #[doc = "[Required] The compute power action."] + #[doc = "The compute power action."] #[serde(default, skip_serializing_if = "Option::is_none")] pub action: Option, #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] @@ -3629,8 +3547,6 @@ pub enum ConnectionAuthType { None, #[serde(rename = "SAS")] Sas, - ServicePrincipal, - AccessKey, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3661,13 +3577,49 @@ impl Serialize for ConnectionAuthType { Self::UsernamePassword => serializer.serialize_unit_variant("ConnectionAuthType", 2u32, "UsernamePassword"), Self::None => serializer.serialize_unit_variant("ConnectionAuthType", 3u32, "None"), Self::Sas => serializer.serialize_unit_variant("ConnectionAuthType", 4u32, "SAS"), - Self::ServicePrincipal => serializer.serialize_unit_variant("ConnectionAuthType", 5u32, "ServicePrincipal"), - Self::AccessKey => serializer.serialize_unit_variant("ConnectionAuthType", 6u32, "AccessKey"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } -pub type ConnectionCategory = String; +#[doc = "Category of the connection"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ConnectionCategory")] +pub enum ConnectionCategory { + PythonFeed, + ContainerRegistry, + Git, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ConnectionCategory { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ConnectionCategory { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ConnectionCategory { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::PythonFeed => serializer.serialize_unit_variant("ConnectionCategory", 0u32, "PythonFeed"), + Self::ContainerRegistry => serializer.serialize_unit_variant("ConnectionCategory", 1u32, "ContainerRegistry"), + Self::Git => serializer.serialize_unit_variant("ConnectionCategory", 2u32, "Git"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Resource requirements for each container instance within an online deployment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContainerResourceRequirements { @@ -3754,8 +3706,6 @@ pub enum CredentialsType { None, Sas, ServicePrincipal, - KerberosKeytab, - KerberosPassword, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3786,8 +3736,6 @@ impl Serialize for CredentialsType { Self::None => serializer.serialize_unit_variant("CredentialsType", 2u32, "None"), Self::Sas => serializer.serialize_unit_variant("CredentialsType", 3u32, "Sas"), Self::ServicePrincipal => serializer.serialize_unit_variant("CredentialsType", 4u32, "ServicePrincipal"), - Self::KerberosKeytab => serializer.serialize_unit_variant("CredentialsType", 5u32, "KerberosKeytab"), - Self::KerberosPassword => serializer.serialize_unit_variant("CredentialsType", 6u32, "KerberosPassword"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -3822,26 +3770,6 @@ impl CronTrigger { Self { trigger_base, expression } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CsvExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CsvExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} #[doc = "The desired maximum forecast horizon in units of time-series frequency."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomForecastHorizon { @@ -3919,11 +3847,13 @@ pub struct CustomService { #[doc = "Name of the Custom Service"] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, + #[doc = "Describes the Image Specifications"] #[serde(default, skip_serializing_if = "Option::is_none")] pub image: Option, #[doc = "Environment Variable for the container"] #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] pub environment_variables: Option, + #[doc = "Docker container configuration"] #[serde(default, skip_serializing_if = "Option::is_none")] pub docker: Option, #[doc = "Configuring the endpoints for the container"] @@ -4153,7 +4083,7 @@ pub struct DataVersionBase { #[doc = "Enum to determine the type of data."] #[serde(rename = "dataType")] pub data_type: DataType, - #[doc = "[Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.Assets.DataVersionBase.DataType"] + #[doc = "[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330"] #[serde(rename = "dataUri")] pub data_uri: String, } @@ -4287,22 +4217,6 @@ impl DatabricksSchema { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The unique name of the labeled data asset."] - #[serde(rename = "labeledAssetName", default, skip_serializing_if = "Option::is_none")] - pub labeled_asset_name: Option, -} -impl DatasetExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - labeled_asset_name: None, - } - } -} #[doc = "Base definition for datastore contents configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Datastore { @@ -4334,7 +4248,6 @@ pub enum DatastoreUnion { AzureDataLakeGen1(AzureDataLakeGen1Datastore), AzureDataLakeGen2(AzureDataLakeGen2Datastore), AzureFile(AzureFileDatastore), - Hdfs(HdfsDatastore), } #[doc = "Base definition for datastore credentials."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -4353,8 +4266,6 @@ impl DatastoreCredentials { pub enum DatastoreCredentialsUnion { AccountKey(AccountKeyDatastoreCredentials), Certificate(CertificateDatastoreCredentials), - KerberosKeytab(KerberosKeytabCredentials), - KerberosPassword(KerberosPasswordCredentials), None(NoneDatastoreCredentials), Sas(SasDatastoreCredentials), ServicePrincipal(ServicePrincipalDatastoreCredentials), @@ -4417,8 +4328,6 @@ impl DatastoreSecrets { pub enum DatastoreSecretsUnion { AccountKey(AccountKeyDatastoreSecrets), Certificate(CertificateDatastoreSecrets), - KerberosKeytab(KerberosKeytabSecrets), - KerberosPassword(KerberosPasswordSecrets), Sas(SasDatastoreSecrets), ServicePrincipal(ServicePrincipalDatastoreSecrets), } @@ -4430,7 +4339,6 @@ pub enum DatastoreType { AzureDataLakeGen1, AzureDataLakeGen2, AzureFile, - Hdfs, #[serde(skip_deserializing)] UnknownValue(String), } @@ -4460,7 +4368,6 @@ impl Serialize for DatastoreType { Self::AzureDataLakeGen1 => serializer.serialize_unit_variant("DatastoreType", 1u32, "AzureDataLakeGen1"), Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("DatastoreType", 2u32, "AzureDataLakeGen2"), Self::AzureFile => serializer.serialize_unit_variant("DatastoreType", 3u32, "AzureFile"), - Self::Hdfs => serializer.serialize_unit_variant("DatastoreType", 4u32, "Hdfs"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -4804,6 +4711,7 @@ impl Serialize for DistributionType { } } } +#[doc = "Docker container configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Docker { #[doc = "Indicate whether container shall run in privileged or non-privileged mode."] @@ -4940,17 +4848,6 @@ impl EncryptionKeyVaultProperties { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionKeyVaultUpdateProperties { - #[doc = "Key Vault uri to access the encryption key."] - #[serde(rename = "keyIdentifier")] - pub key_identifier: String, -} -impl EncryptionKeyVaultUpdateProperties { - pub fn new(key_identifier: String) -> Self { - Self { key_identifier } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EncryptionProperty { #[doc = "Indicates whether or not the encryption is enabled for the workspace."] pub status: encryption_property::Status, @@ -5009,16 +4906,7 @@ pub mod encryption_property { } } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionUpdateProperties { - #[serde(rename = "keyVaultProperties")] - pub key_vault_properties: EncryptionKeyVaultUpdateProperties, -} -impl EncryptionUpdateProperties { - pub fn new(key_vault_properties: EncryptionKeyVaultUpdateProperties) -> Self { - Self { key_vault_properties } - } -} +#[doc = "Describes the endpoint configuration for the container"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Endpoint { #[doc = "Protocol over which communication will happen over this endpoint"] @@ -5218,7 +5106,7 @@ pub struct EndpointDeploymentPropertiesBase { #[doc = "Description of the endpoint deployment."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, - #[doc = "ARM resource ID of the environment specification for the endpoint deployment."] + #[doc = "ARM resource ID or AssetId of the environment specification for the endpoint deployment."] #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] pub environment_id: Option, #[doc = "Environment variables configuration for the deployment."] @@ -5328,6 +5216,47 @@ impl EndpointScheduleAction { } } } +#[doc = "Connection status of the service consumer with the service provider"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "EndpointServiceConnectionStatus")] +pub enum EndpointServiceConnectionStatus { + Approved, + Pending, + Rejected, + Disconnected, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for EndpointServiceConnectionStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for EndpointServiceConnectionStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for EndpointServiceConnectionStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Approved => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 0u32, "Approved"), + Self::Pending => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 1u32, "Pending"), + Self::Rejected => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 2u32, "Rejected"), + Self::Disconnected => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 3u32, "Disconnected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Container for environment specification versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentContainer { @@ -5420,6 +5349,7 @@ impl Serialize for EnvironmentType { } } } +#[doc = "Environment Variables for the container"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentVariable { #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] @@ -5483,6 +5413,9 @@ pub mod environment_variable { pub struct EnvironmentVersion { #[serde(flatten)] pub asset_base: AssetBase, + #[doc = "AutoRebuild setting for the derived image"] + #[serde(rename = "autoRebuild", default, skip_serializing_if = "Option::is_none")] + pub auto_rebuild: Option, #[doc = "Configuration settings for Docker build context"] #[serde(default, skip_serializing_if = "Option::is_none")] pub build: Option, @@ -5503,6 +5436,9 @@ pub struct EnvironmentVersion { #[doc = "Provisioning state of registry asset."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, + #[doc = "Stage in the environment lifecycle assigned to this environment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stage: Option, } impl EnvironmentVersion { pub fn new() -> Self { @@ -5816,82 +5752,6 @@ pub mod estimated_vm_prices { } } } -#[doc = "The format of exported labels."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ExportFormatType")] -pub enum ExportFormatType { - Dataset, - Coco, - #[serde(rename = "CSV")] - Csv, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ExportFormatType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ExportFormatType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ExportFormatType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dataset => serializer.serialize_unit_variant("ExportFormatType", 0u32, "Dataset"), - Self::Coco => serializer.serialize_unit_variant("ExportFormatType", 1u32, "Coco"), - Self::Csv => serializer.serialize_unit_variant("ExportFormatType", 2u32, "CSV"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportSummary { - #[doc = "The time when the export was completed."] - #[serde(rename = "endDateTime", default, with = "azure_core::date::rfc3339::option")] - pub end_date_time: Option, - #[doc = "The total number of labeled datapoints exported."] - #[serde(rename = "exportedRowCount", default, skip_serializing_if = "Option::is_none")] - pub exported_row_count: Option, - #[doc = "The format of exported labels."] - pub format: ExportFormatType, - #[doc = "Name and identifier of the job containing exported labels."] - #[serde(rename = "labelingJobId", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_id: Option, - #[doc = "The time when the export was requested."] - #[serde(rename = "startDateTime", default, with = "azure_core::date::rfc3339::option")] - pub start_date_time: Option, -} -impl ExportSummary { - pub fn new(format: ExportFormatType) -> Self { - Self { - end_date_time: None, - exported_row_count: None, - format, - labeling_job_id: None, - start_date_time: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "format")] -pub enum ExportSummaryUnion { - Coco(CocoExportSummary), - #[serde(rename = "CSV")] - Csv(CsvExportSummary), - Dataset(DatasetExportSummary), -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalFqdnResponse { #[serde( @@ -6434,30 +6294,6 @@ impl HdInsightSchema { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdfsDatastore { - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if \"Https\" protocol is selected."] - #[serde(rename = "hdfsServerCertificate", default, skip_serializing_if = "Option::is_none")] - pub hdfs_server_certificate: Option, - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "nameNodeAddress")] - pub name_node_address: String, - #[doc = "Protocol used to communicate with the storage account (Https/Http)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, -} -impl HdfsDatastore { - pub fn new(datastore: Datastore, name_node_address: String) -> Self { - Self { - datastore, - hdfs_server_certificate: None, - name_node_address, - protocol: None, - } - } -} #[doc = "Reference to an asset via its ARM resource ID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdAssetReference { @@ -6559,12 +6395,13 @@ impl IdleShutdownSetting { Self::default() } } +#[doc = "Describes the Image Specifications"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Image { #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, - #[doc = "Image reference URL"] + #[doc = "Image reference"] #[serde(default, skip_serializing_if = "Option::is_none")] pub reference: Option, } @@ -6620,46 +6457,7 @@ pub mod image { } } } -#[doc = "Annotation type of image data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImageAnnotationType")] -pub enum ImageAnnotationType { - Classification, - BoundingBox, - InstanceSegmentation, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ImageAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ImageAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ImageAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("ImageAnnotationType", 0u32, "Classification"), - Self::BoundingBox => serializer.serialize_unit_variant("ImageAnnotationType", 1u32, "BoundingBox"), - Self::InstanceSegmentation => serializer.serialize_unit_variant("ImageAnnotationType", 2u32, "InstanceSegmentation"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Image Classification. Multi-class image classification is used when an image is classified with only a single label\r\nfrom a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'."] +#[doc = "Image Classification. Multi-class image classification is used when an image is classified with only a single label\r\nfrom a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageClassification { #[serde(flatten)] @@ -6780,7 +6578,7 @@ impl ImageMetadata { Self::default() } } -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] +#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageModelDistributionSettings { #[doc = "Enable AMSGrad when optimizer is 'adam' or 'adamw'."] @@ -6873,7 +6671,7 @@ impl ImageModelDistributionSettings { Self::default() } } -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] +#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageModelDistributionSettingsClassification { #[serde(flatten)] @@ -6896,7 +6694,7 @@ impl ImageModelDistributionSettingsClassification { Self::default() } } -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] +#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImageModelDistributionSettingsObjectDetection { #[serde(flatten)] @@ -7402,9 +7200,7 @@ pub enum JobBaseUnion { #[serde(rename = "AutoML")] AutoMl(AutoMlJob), Command(CommandJob), - Labeling(LabelingJob), Pipeline(PipelineJob), - Spark(SparkJob), Sweep(SweepJob), } #[doc = "Azure Resource Manager resource envelope."] @@ -7681,47 +7477,6 @@ impl Serialize for JobOutputType { } } } -#[doc = "Enum to determine the job provisioning state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobProvisioningState")] -pub enum JobProvisioningState { - Succeeded, - Failed, - Canceled, - InProgress, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("JobProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("JobProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobProvisioningState", 2u32, "Canceled"), - Self::InProgress => serializer.serialize_unit_variant("JobProvisioningState", 3u32, "InProgress"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobResourceConfiguration { #[serde(flatten)] @@ -7769,7 +7524,7 @@ pub struct JobService { #[doc = "Abstract Nodes definition"] #[serde(default, skip_serializing_if = "Option::is_none")] pub nodes: Option, - #[doc = "Port for endpoint set by user."] + #[doc = "Port for endpoint."] #[serde(default, skip_serializing_if = "Option::is_none")] pub port: Option, #[doc = "Additional properties to set on the endpoint."] @@ -7802,7 +7557,6 @@ pub enum JobStatus { NotResponding, Paused, Unknown, - Scheduled, #[serde(skip_deserializing)] UnknownValue(String), } @@ -7842,7 +7596,6 @@ impl Serialize for JobStatus { Self::NotResponding => serializer.serialize_unit_variant("JobStatus", 11u32, "NotResponding"), Self::Paused => serializer.serialize_unit_variant("JobStatus", 12u32, "Paused"), Self::Unknown => serializer.serialize_unit_variant("JobStatus", 13u32, "Unknown"), - Self::Scheduled => serializer.serialize_unit_variant("JobStatus", 14u32, "Scheduled"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -7854,10 +7607,8 @@ pub enum JobType { #[serde(rename = "AutoML")] AutoMl, Command, - Labeling, Sweep, Pipeline, - Spark, #[serde(skip_deserializing)] UnknownValue(String), } @@ -7885,110 +7636,13 @@ impl Serialize for JobType { match self { Self::AutoMl => serializer.serialize_unit_variant("JobType", 0u32, "AutoML"), Self::Command => serializer.serialize_unit_variant("JobType", 1u32, "Command"), - Self::Labeling => serializer.serialize_unit_variant("JobType", 2u32, "Labeling"), - Self::Sweep => serializer.serialize_unit_variant("JobType", 3u32, "Sweep"), - Self::Pipeline => serializer.serialize_unit_variant("JobType", 4u32, "Pipeline"), - Self::Spark => serializer.serialize_unit_variant("JobType", 5u32, "Spark"), + Self::Sweep => serializer.serialize_unit_variant("JobType", 2u32, "Sweep"), + Self::Pipeline => serializer.serialize_unit_variant("JobType", 3u32, "Pipeline"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosCredentials { - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "kerberosKdcAddress")] - pub kerberos_kdc_address: String, - #[doc = "[Required] Kerberos Username"] - #[serde(rename = "kerberosPrincipal")] - pub kerberos_principal: String, - #[doc = "[Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service."] - #[serde(rename = "kerberosRealm")] - pub kerberos_realm: String, -} -impl KerberosCredentials { - pub fn new(kerberos_kdc_address: String, kerberos_principal: String, kerberos_realm: String) -> Self { - Self { - kerberos_kdc_address, - kerberos_principal, - kerberos_realm, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosKeytabSecrets, -} -impl KerberosKeytabCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosKeytabSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos keytab secret."] - #[serde(rename = "kerberosKeytab", default, skip_serializing_if = "Option::is_none")] - pub kerberos_keytab: Option, -} -impl KerberosKeytabSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_keytab: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosPasswordSecrets, -} -impl KerberosPasswordCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosPasswordSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos password secret."] - #[serde(rename = "kerberosPassword", default, skip_serializing_if = "Option::is_none")] - pub kerberos_password: Option, -} -impl KerberosPasswordSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_password: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "KeyType")] pub enum KeyType { Primary, @@ -8102,217 +7756,6 @@ impl KubernetesSchema { Self::default() } } -#[doc = "Label category definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelCategory { - #[doc = "Dictionary of label classes in this category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub classes: Option, - #[doc = "Display name of the label category."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Indicates whether it is allowed to select multiple classes in this category."] - #[serde(rename = "multiSelectEnabled", default, skip_serializing_if = "Option::is_none")] - pub multi_select_enabled: Option, -} -impl LabelCategory { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label class definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelClass { - #[doc = "Display name of the label class."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Dictionary of subclasses of the label class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subclasses: Option, -} -impl LabelClass { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling data configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingDataConfiguration { - #[doc = "Resource Id of the data asset to perform labeling."] - #[serde(rename = "dataId", default, skip_serializing_if = "Option::is_none")] - pub data_id: Option, - #[doc = "Indicates whether to enable incremental data refresh."] - #[serde(rename = "incrementalDataRefreshEnabled", default, skip_serializing_if = "Option::is_none")] - pub incremental_data_refresh_enabled: Option, -} -impl LabelingDataConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling job definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Created time of the job in UTC timezone."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[doc = "Labeling data configuration definition"] - #[serde(rename = "dataConfiguration", default, skip_serializing_if = "Option::is_none")] - pub data_configuration: Option, - #[doc = "Instructions for labeling job"] - #[serde(rename = "jobInstructions", default, skip_serializing_if = "Option::is_none")] - pub job_instructions: Option, - #[doc = "Label categories of the job."] - #[serde(rename = "labelCategories", default, skip_serializing_if = "Option::is_none")] - pub label_categories: Option, - #[doc = "Properties of a labeling job"] - #[serde(rename = "labelingJobMediaProperties", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_media_properties: Option, - #[doc = "Labeling MLAssist configuration definition"] - #[serde(rename = "mlAssistConfiguration", default, skip_serializing_if = "Option::is_none")] - pub ml_assist_configuration: Option, - #[doc = "Progress metrics definition"] - #[serde(rename = "progressMetrics", default, skip_serializing_if = "Option::is_none")] - pub progress_metrics: Option, - #[doc = "Internal id of the job(Previously called project)."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option, - #[doc = "Enum to determine the job provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Status messages of the job."] - #[serde( - rename = "statusMessages", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub status_messages: Vec, -} -impl LabelingJob { - pub fn new(job_base: JobBase) -> Self { - Self { - job_base, - created_date_time: None, - data_configuration: None, - job_instructions: None, - label_categories: None, - labeling_job_media_properties: None, - ml_assist_configuration: None, - progress_metrics: None, - project_id: None, - provisioning_state: None, - status_messages: Vec::new(), - } - } -} -#[doc = "Properties of a labeling job for image data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobImageProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of image data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobImageProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[doc = "Instructions for labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobInstructions { - #[doc = "The link to a page with detailed labeling instructions for labelers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, -} -impl LabelingJobInstructions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobMediaProperties { - #[doc = "Media type of data asset."] - #[serde(rename = "mediaType")] - pub media_type: MediaType, -} -impl LabelingJobMediaProperties { - pub fn new(media_type: MediaType) -> Self { - Self { media_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mediaType")] -pub enum LabelingJobMediaPropertiesUnion { - Image(LabelingJobImageProperties), - Text(LabelingJobTextProperties), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Labeling job definition"] - pub properties: LabelingJob, -} -impl LabelingJobResource { - pub fn new(properties: LabelingJob) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of LabelingJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobResourceArmPaginatedResult { - #[doc = "The link to the next page of LabelingJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type LabelingJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for LabelingJobResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl LabelingJobResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job for text data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobTextProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of text data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobTextProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} #[doc = "Learning rate scheduler enum."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "LearningRateScheduler")] @@ -8563,132 +8006,6 @@ impl Serialize for LogVerbosity { } } } -#[doc = "Labeling MLAssist configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfiguration { - #[serde(rename = "mlAssist")] - pub ml_assist: MlAssistConfigurationType, -} -impl MlAssistConfiguration { - pub fn new(ml_assist: MlAssistConfigurationType) -> Self { - Self { ml_assist } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mlAssist")] -pub enum MlAssistConfigurationUnion { - Disabled(MlAssistConfigurationDisabled), - Enabled(MlAssistConfigurationEnabled), -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is disabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationDisabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, -} -impl MlAssistConfigurationDisabled { - pub fn new(ml_assist_configuration: MlAssistConfiguration) -> Self { - Self { ml_assist_configuration } - } -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationEnabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, - #[doc = "[Required] AML compute binding used in inferencing."] - #[serde(rename = "inferencingComputeBinding")] - pub inferencing_compute_binding: String, - #[doc = "[Required] AML compute binding used in training."] - #[serde(rename = "trainingComputeBinding")] - pub training_compute_binding: String, -} -impl MlAssistConfigurationEnabled { - pub fn new( - ml_assist_configuration: MlAssistConfiguration, - inferencing_compute_binding: String, - training_compute_binding: String, - ) -> Self { - Self { - ml_assist_configuration, - inferencing_compute_binding, - training_compute_binding, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlAssistConfigurationType")] -pub enum MlAssistConfigurationType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlAssistConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlAssistConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlAssistConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the state of mlflow autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlFlowAutologgerState")] -pub enum MlFlowAutologgerState { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlFlowAutologgerState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlFlowAutologgerState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlFlowAutologgerState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MlFlowModelJobInput { #[serde(flatten)] @@ -8876,55 +8193,18 @@ impl<'de> Deserialize<'de> for ManagedServiceIdentityType { Ok(deserialized) } } -impl Serialize for ManagedServiceIdentityType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), - Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), - Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), - Self::SystemAssignedUserAssigned => { - serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned,UserAssigned") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Media type of data asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MediaType")] -pub enum MediaType { - Image, - Text, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MediaType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MediaType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MediaType { +impl Serialize for ManagedServiceIdentityType { fn serialize(&self, serializer: S) -> std::result::Result where S: Serializer, { match self { - Self::Image => serializer.serialize_unit_variant("MediaType", 0u32, "Image"), - Self::Text => serializer.serialize_unit_variant("MediaType", 1u32, "Text"), + Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => { + serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned,UserAssigned") + } Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -9056,6 +8336,9 @@ pub struct ModelVersion { #[doc = "Provisioning state of registry asset."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, + #[doc = "Stage in the model lifecycle assigned to this model"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stage: Option, } impl ModelVersion { pub fn new() -> Self { @@ -9174,164 +8457,14 @@ impl Serialize for NCrossValidationsMode { } } } -#[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpFixedParameters { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NlpLearningRateScheduler")] -pub enum NlpLearningRateScheduler { - None, - Linear, - Cosine, - CosineWithRestarts, - Polynomial, - Constant, - ConstantWithWarmup, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NlpLearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NlpLearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NlpLearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("NlpLearningRateScheduler", 0u32, "None"), - Self::Linear => serializer.serialize_unit_variant("NlpLearningRateScheduler", 1u32, "Linear"), - Self::Cosine => serializer.serialize_unit_variant("NlpLearningRateScheduler", 2u32, "Cosine"), - Self::CosineWithRestarts => serializer.serialize_unit_variant("NlpLearningRateScheduler", 3u32, "CosineWithRestarts"), - Self::Polynomial => serializer.serialize_unit_variant("NlpLearningRateScheduler", 4u32, "Polynomial"), - Self::Constant => serializer.serialize_unit_variant("NlpLearningRateScheduler", 5u32, "Constant"), - Self::ConstantWithWarmup => serializer.serialize_unit_variant("NlpLearningRateScheduler", 6u32, "ConstantWithWarmup"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stringified search spaces for each parameter. See below examples."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpParameterSubspace { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "The type of learning rate schedule to use during the training procedure."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model sweeping and hyperparameter tuning related settings."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NlpSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl NlpSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} #[doc = "Abstract class for NLP related AutoML tasks.\r\nNLP - Natural Language Processing."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NlpVertical { #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, #[doc = "Job execution constraints."] #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] pub limit_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[doc = "Model sweeping and hyperparameter tuning related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] pub validation_data: Option, } @@ -9356,18 +8489,12 @@ pub struct NlpVerticalLimitSettings { #[doc = "Maximum Concurrent AutoML iterations."] #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] pub max_concurrent_trials: Option, - #[doc = "Maximum nodes to leverage for training in any single trial. Controls multi-node distributed training."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, #[doc = "Number of AutoML iterations."] #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] pub max_trials: Option, #[doc = "AutoML job timeout."] #[serde(default, skip_serializing_if = "Option::is_none")] pub timeout: Option, - #[doc = "Timeout for individual HD trials."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, } impl NlpVerticalLimitSettings { pub fn new() -> Self { @@ -9423,7 +8550,6 @@ pub enum NodesUnion { #[serde(remote = "NodesValueType")] pub enum NodesValueType { All, - Custom, #[serde(skip_deserializing)] UnknownValue(String), } @@ -9450,7 +8576,6 @@ impl Serialize for NodesValueType { { match self { Self::All => serializer.serialize_unit_variant("NodesValueType", 0u32, "All"), - Self::Custom => serializer.serialize_unit_variant("NodesValueType", 1u32, "Custom"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -9894,7 +9019,6 @@ impl Serialize for OrderString { pub enum OutputDeliveryMode { ReadWriteMount, Upload, - Direct, #[serde(skip_deserializing)] UnknownValue(String), } @@ -9922,7 +9046,6 @@ impl Serialize for OutputDeliveryMode { match self { Self::ReadWriteMount => serializer.serialize_unit_variant("OutputDeliveryMode", 0u32, "ReadWriteMount"), Self::Upload => serializer.serialize_unit_variant("OutputDeliveryMode", 1u32, "Upload"), - Self::Direct => serializer.serialize_unit_variant("OutputDeliveryMode", 2u32, "Direct"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -10083,13 +9206,7 @@ impl PartialRegistry { pub struct PartialRegistryPartialTrackedResource { #[doc = "Managed service identity (system assigned and/or user assigned identities)"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Partial Registry class for PATCH"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub identity: Option, #[doc = "Common SKU definition."] #[serde(default, skip_serializing_if = "Option::is_none")] pub sku: Option, @@ -10145,6 +9262,126 @@ impl Password { Self::default() } } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PendingUploadCredentialDto { + #[doc = "Enum to determine the PendingUpload credentials type."] + #[serde(rename = "credentialType")] + pub credential_type: PendingUploadCredentialType, +} +impl PendingUploadCredentialDto { + pub fn new(credential_type: PendingUploadCredentialType) -> Self { + Self { credential_type } + } +} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "credentialType")] +pub enum PendingUploadCredentialDtoUnion { + #[serde(rename = "SAS")] + Sas(SasCredentialDto), +} +#[doc = "Enum to determine the PendingUpload credentials type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PendingUploadCredentialType")] +pub enum PendingUploadCredentialType { + #[serde(rename = "SAS")] + Sas, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PendingUploadCredentialType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PendingUploadCredentialType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PendingUploadCredentialType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Sas => serializer.serialize_unit_variant("PendingUploadCredentialType", 0u32, "SAS"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PendingUploadRequestDto { + #[doc = "If PendingUploadId = null then random guid will be used."] + #[serde(rename = "pendingUploadId", default, skip_serializing_if = "Option::is_none")] + pub pending_upload_id: Option, + #[doc = "Type of storage to use for the pending upload location"] + #[serde(rename = "pendingUploadType", default, skip_serializing_if = "Option::is_none")] + pub pending_upload_type: Option, +} +impl PendingUploadRequestDto { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PendingUploadResponseDto { + #[serde(rename = "blobReferenceForConsumption", default, skip_serializing_if = "Option::is_none")] + pub blob_reference_for_consumption: Option, + #[doc = "ID for this upload request"] + #[serde(rename = "pendingUploadId", default, skip_serializing_if = "Option::is_none")] + pub pending_upload_id: Option, + #[doc = "Type of storage to use for the pending upload location"] + #[serde(rename = "pendingUploadType", default, skip_serializing_if = "Option::is_none")] + pub pending_upload_type: Option, +} +impl PendingUploadResponseDto { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Type of storage to use for the pending upload location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PendingUploadType")] +pub enum PendingUploadType { + None, + TemporaryBlobReference, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PendingUploadType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PendingUploadType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PendingUploadType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("PendingUploadType", 0u32, "None"), + Self::TemporaryBlobReference => serializer.serialize_unit_variant("PendingUploadType", 1u32, "TemporaryBlobReference"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Settings for a personal compute instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PersonalComputeInstanceSettings { @@ -10196,9 +9433,6 @@ pub struct PrivateEndpoint { #[doc = "The ARM identifier for Private Endpoint"] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, - #[doc = "The ARM identifier for Subnet resource that private endpoint links to"] - #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] - pub subnet_arm_id: Option, } impl PrivateEndpoint { pub fn new() -> Self { @@ -10316,6 +9550,20 @@ impl Serialize for PrivateEndpointConnectionProvisioningState { } } } +#[doc = "The PE network resource that is linked to this PE connection."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointResource { + #[serde(flatten)] + pub private_endpoint: PrivateEndpoint, + #[doc = "The subnetId that the private endpoint is connected to."] + #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] + pub subnet_arm_id: Option, +} +impl PrivateEndpointResource { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The private endpoint connection status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PrivateEndpointServiceConnectionStatus")] @@ -10471,27 +9719,6 @@ impl ProbeSettings { Self::default() } } -#[doc = "Progress metrics definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProgressMetrics { - #[doc = "The completed datapoint count."] - #[serde(rename = "completedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub completed_datapoint_count: Option, - #[doc = "The time of last successful incremental data refresh in UTC."] - #[serde(rename = "incrementalDataLastRefreshDateTime", default, with = "azure_core::date::rfc3339::option")] - pub incremental_data_last_refresh_date_time: Option, - #[doc = "The skipped datapoint count."] - #[serde(rename = "skippedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub skipped_datapoint_count: Option, - #[doc = "The total datapoint count."] - #[serde(rename = "totalDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub total_datapoint_count: Option, -} -impl ProgressMetrics { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "PublicNetworkAccessType")] @@ -10857,49 +10084,130 @@ impl RegenerateEndpointKeysRequest { #[doc = "Details of the Registry"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Registry { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, + #[doc = "Discovery URL for the Registry"] #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] pub discovery_url: Option, + #[doc = "IntellectualPropertyPublisher for the registry"] #[serde(rename = "intellectualPropertyPublisher", default, skip_serializing_if = "Option::is_none")] pub intellectual_property_publisher: Option, #[doc = "ARM ResourceId of a resource"] #[serde(rename = "managedResourceGroup", default, skip_serializing_if = "Option::is_none")] pub managed_resource_group: Option, + #[doc = "MLFlow Registry URI for the Registry"] #[serde(rename = "mlFlowRegistryUri", default, skip_serializing_if = "Option::is_none")] pub ml_flow_registry_uri: Option, - #[serde(rename = "privateLinkCount", default, skip_serializing_if = "Option::is_none")] - pub private_link_count: Option, + #[doc = "Private endpoint connections info used for pending connections in private link portal"] + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "Is the Registry accessible from the internet?\r\nPossible values: \"Enabled\" or \"Disabled\""] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, #[doc = "Details of each region the registry is in"] #[serde( - rename = "regionDetails", + rename = "regionDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub region_details: Vec, +} +impl Registry { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegistryListCredentialsResult { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub passwords: Vec, +} +impl RegistryListCredentialsResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Managed service identity (system assigned and/or user assigned identities)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegistryPartialManagedServiceIdentity { + #[serde(flatten)] + pub managed_service_identity: ManagedServiceIdentity, +} +impl RegistryPartialManagedServiceIdentity { + pub fn new(managed_service_identity: ManagedServiceIdentity) -> Self { + Self { managed_service_identity } + } +} +#[doc = "Private endpoint connection definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegistryPrivateEndpointConnection { + #[doc = "This is the private endpoint connection name created on SRP\r\nFull resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Same as workspace location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Properties of the Private Endpoint Connection"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegistryPrivateEndpointConnection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Private Endpoint Connection"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegistryPrivateEndpointConnectionProperties { + #[doc = "The group ids"] + #[serde( + rename = "groupIds", default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub region_details: Vec, + pub group_ids: Vec, + #[doc = "The PE network resource that is linked to this PE connection."] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "The connection state."] + #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] + pub private_link_service_connection_state: Option, + #[doc = "One of null, \"Succeeded\", \"Provisioning\", \"Failed\". While not approved, it's null."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, } -impl Registry { +impl RegistryPrivateEndpointConnectionProperties { pub fn new() -> Self { Self::default() } } +#[doc = "The connection state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryListCredentialsResult { +pub struct RegistryPrivateLinkServiceConnectionState { + #[doc = "Some RP chose \"None\". Other RPs use this for region expansion."] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, + #[doc = "User-defined message that, per NRP doc, may be used for approval-related message."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, + pub description: Option, + #[doc = "Connection status of the service consumer with the service provider"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub passwords: Vec, + pub status: Option, } -impl RegistryListCredentialsResult { +impl RegistryPrivateLinkServiceConnectionState { pub fn new() -> Self { Self::default() } @@ -11310,6 +10618,22 @@ impl SasAuthTypeWorkspaceConnectionProperties { } } } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SasCredentialDto { + #[serde(flatten)] + pub pending_upload_credential_dto: PendingUploadCredentialDto, + #[doc = "Full SAS Uri, including the storage, container/blob path and SAS token"] + #[serde(rename = "sasUri", default, skip_serializing_if = "Option::is_none")] + pub sas_uri: Option, +} +impl SasCredentialDto { + pub fn new(pending_upload_credential_dto: PendingUploadCredentialDto) -> Self { + Self { + pending_upload_credential_dto, + sas_uri: None, + } + } +} #[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SamplingAlgorithm { @@ -11863,8 +11187,6 @@ pub enum SecretsType { Certificate, Sas, ServicePrincipal, - KerberosPassword, - KerberosKeytab, #[serde(skip_deserializing)] UnknownValue(String), } @@ -11894,8 +11216,6 @@ impl Serialize for SecretsType { Self::Certificate => serializer.serialize_unit_variant("SecretsType", 1u32, "Certificate"), Self::Sas => serializer.serialize_unit_variant("SecretsType", 2u32, "Sas"), Self::ServicePrincipal => serializer.serialize_unit_variant("SecretsType", 3u32, "ServicePrincipal"), - Self::KerberosPassword => serializer.serialize_unit_variant("SecretsType", 4u32, "KerberosPassword"), - Self::KerberosKeytab => serializer.serialize_unit_variant("SecretsType", 5u32, "KerberosKeytab"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -11952,21 +11272,6 @@ impl ServiceManagedResourcesSettings { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ServicePrincipalAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} #[doc = "Service Principal datastore credentials configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServicePrincipalDatastoreCredentials { @@ -12263,177 +11568,6 @@ pub enum SkuTier { Standard, Premium, } -#[doc = "Spark job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Archive files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub archives: Vec, - #[doc = "Arguments for the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub args: Option, - #[doc = "[Required] ARM resource ID of the code asset."] - #[serde(rename = "codeId")] - pub code_id: String, - #[doc = "Spark configured properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub conf: Option, - #[doc = "Spark job entry point definition."] - pub entry: SparkJobEntryUnion, - #[doc = "The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub files: Vec, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jar files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub jars: Vec, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Python files used in the job."] - #[serde( - rename = "pyFiles", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub py_files: Vec, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl SparkJob { - pub fn new(job_base: JobBase, code_id: String, entry: SparkJobEntryUnion) -> Self { - Self { - job_base, - archives: Vec::new(), - args: None, - code_id, - conf: None, - entry, - environment_id: None, - files: Vec::new(), - inputs: None, - jars: Vec::new(), - outputs: None, - py_files: Vec::new(), - resources: None, - } - } -} -#[doc = "Spark job entry point definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobEntry { - #[serde(rename = "sparkJobEntryType")] - pub spark_job_entry_type: SparkJobEntryType, -} -impl SparkJobEntry { - pub fn new(spark_job_entry_type: SparkJobEntryType) -> Self { - Self { spark_job_entry_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "sparkJobEntryType")] -pub enum SparkJobEntryUnion { - SparkJobPythonEntry(SparkJobPythonEntry), - SparkJobScalaEntry(SparkJobScalaEntry), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SparkJobEntryType")] -pub enum SparkJobEntryType { - SparkJobPythonEntry, - SparkJobScalaEntry, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SparkJobEntryType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SparkJobEntryType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SparkJobEntryType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SparkJobPythonEntry => serializer.serialize_unit_variant("SparkJobEntryType", 0u32, "SparkJobPythonEntry"), - Self::SparkJobScalaEntry => serializer.serialize_unit_variant("SparkJobEntryType", 1u32, "SparkJobScalaEntry"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobPythonEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Relative python file path for job entry point."] - pub file: String, -} -impl SparkJobPythonEntry { - pub fn new(spark_job_entry: SparkJobEntry, file: String) -> Self { - Self { spark_job_entry, file } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobScalaEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Scala class name used as entry point."] - #[serde(rename = "className")] - pub class_name: String, -} -impl SparkJobScalaEntry { - pub fn new(spark_job_entry: SparkJobEntry, class_name: String) -> Self { - Self { - spark_job_entry, - class_name, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SparkResourceConfiguration { - #[doc = "Optional type of VM used as supported by the compute target."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Version of spark runtime used for the job."] - #[serde(rename = "runtimeVersion", default, skip_serializing_if = "Option::is_none")] - pub runtime_version: Option, -} -impl SparkResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} #[doc = "The ssl configuration for scoring"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SslConfiguration { @@ -12574,64 +11708,6 @@ impl Serialize for StackMetaLearnerType { } } } -#[doc = "Active message associated with project"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StatusMessage { - #[doc = "Service-defined message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Time in UTC at which the message was created."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "A human-readable representation of the message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl StatusMessage { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StatusMessageLevel")] -pub enum StatusMessageLevel { - Error, - Information, - Warning, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StatusMessageLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StatusMessageLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StatusMessageLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Error => serializer.serialize_unit_variant("StatusMessageLevel", 0u32, "Error"), - Self::Information => serializer.serialize_unit_variant("StatusMessageLevel", 1u32, "Information"), - Self::Warning => serializer.serialize_unit_variant("StatusMessageLevel", 2u32, "Warning"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Stochastic optimizer for image models."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "StochasticOptimizer")] @@ -12816,6 +11892,10 @@ pub mod synapse_spark { } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SystemCreatedAcrAccount { + #[doc = "Name of the ACR account"] + #[serde(rename = "acrAccountName", default, skip_serializing_if = "Option::is_none")] + pub acr_account_name: Option, + #[doc = "SKU of the ACR account"] #[serde(rename = "acrAccountSku", default, skip_serializing_if = "Option::is_none")] pub acr_account_sku: Option, #[doc = "ARM ResourceId of a resource"] @@ -12829,11 +11909,18 @@ impl SystemCreatedAcrAccount { } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SystemCreatedStorageAccount { + #[doc = "Public blob access allowed"] + #[serde(rename = "allowBlobPublicAccess", default, skip_serializing_if = "Option::is_none")] + pub allow_blob_public_access: Option, #[doc = "ARM ResourceId of a resource"] #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] pub arm_resource_id: Option, + #[doc = "HNS enabled for storage account"] #[serde(rename = "storageAccountHnsEnabled", default, skip_serializing_if = "Option::is_none")] pub storage_account_hns_enabled: Option, + #[doc = "Name of the storage account"] + #[serde(rename = "storageAccountName", default, skip_serializing_if = "Option::is_none")] + pub storage_account_name: Option, #[doc = "Allowed values:\r\n\"Standard_LRS\",\r\n\"Standard_GRS\",\r\n\"Standard_RAGRS\",\r\n\"Standard_ZRS\",\r\n\"Standard_GZRS\",\r\n\"Standard_RAGZRS\",\r\n\"Premium_LRS\",\r\n\"Premium_ZRS\""] #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] pub storage_account_type: Option, @@ -12861,159 +11948,6 @@ impl SystemService { Self::default() } } -#[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableFixedParameters { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample."] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableParameterSubspace { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample"] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TableSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl TableSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} #[doc = "Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TableVertical { @@ -13028,25 +11962,12 @@ pub struct TableVertical { #[doc = "Featurization Configuration."] #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, #[doc = "Job execution constraints."] #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] pub limit_settings: Option, #[doc = "N-Cross validations value."] #[serde(rename = "nCrossValidations", default, skip_serializing_if = "Option::is_none")] pub n_cross_validations: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, #[serde(rename = "testData", default, skip_serializing_if = "Option::is_none")] pub test_data: Option, #[doc = "The fraction of test dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] @@ -13115,12 +12036,6 @@ pub struct TableVerticalLimitSettings { #[doc = "Number of iterations."] #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] pub max_trials: Option, - #[doc = "Number of concurrent sweeping runs that user wants to trigger."] - #[serde(rename = "sweepConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_concurrent_trials: Option, - #[doc = "Number of sweeping runs that user wants to trigger."] - #[serde(rename = "sweepTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_trials: Option, #[doc = "AutoML job timeout."] #[serde(default, skip_serializing_if = "Option::is_none")] pub timeout: Option, @@ -13387,43 +12302,6 @@ impl TensorFlow { } } } -#[doc = "Annotation type of text data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TextAnnotationType")] -pub enum TextAnnotationType { - Classification, - NamedEntityRecognition, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TextAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TextAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TextAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TextAnnotationType", 0u32, "Classification"), - Self::NamedEntityRecognition => serializer.serialize_unit_variant("TextAnnotationType", 1u32, "NamedEntityRecognition"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} #[doc = "Text Classification task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TextClassification { @@ -13484,6 +12362,7 @@ impl TextNer { } } } +#[doc = "Describes the tmpfs options for the container"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TmpfsOptions { #[doc = "Mention the Tmpfs size"] @@ -14340,6 +13219,7 @@ impl VirtualMachineSshCredentials { Self::default() } } +#[doc = "Describes the volume configuration for the container"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VolumeDefinition { #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] @@ -14357,10 +13237,13 @@ pub struct VolumeDefinition { #[doc = "Consistency of the volume"] #[serde(default, skip_serializing_if = "Option::is_none")] pub consistency: Option, + #[doc = "Describes the bind options for the container"] #[serde(default, skip_serializing_if = "Option::is_none")] pub bind: Option, + #[doc = "Describes the volume options for the container"] #[serde(default, skip_serializing_if = "Option::is_none")] pub volume: Option, + #[doc = "Describes the tmpfs options for the container"] #[serde(default, skip_serializing_if = "Option::is_none")] pub tmpfs: Option, } @@ -14422,6 +13305,7 @@ pub mod volume_definition { } } } +#[doc = "Describes the volume options for the container"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VolumeOptions { #[doc = "Indicate whether volume is nocopy"] @@ -14507,18 +13391,6 @@ impl Workspace { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionAccessKey { - #[serde(rename = "accessKeyId", default, skip_serializing_if = "Option::is_none")] - pub access_key_id: Option, - #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, -} -impl WorkspaceConnectionAccessKey { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceConnectionManagedIdentity { #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] pub resource_id: Option, @@ -14610,14 +13482,12 @@ pub mod workspace_connection_properties_v2 { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(tag = "authType")] pub enum WorkspaceConnectionPropertiesV2Union { - AccessKey(AccessKeyAuthTypeWorkspaceConnectionProperties), ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), None(NoneAuthTypeWorkspaceConnectionProperties), #[serde(rename = "PAT")] Pat(PatAuthTypeWorkspaceConnectionProperties), #[serde(rename = "SAS")] Sas(SasAuthTypeWorkspaceConnectionProperties), - ServicePrincipal(ServicePrincipalAuthTypeWorkspaceConnectionProperties), UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -14657,20 +13527,6 @@ impl WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionServicePrincipal { - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, -} -impl WorkspaceConnectionServicePrincipal { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceConnectionSharedAccessSignature { #[serde(default, skip_serializing_if = "Option::is_none")] pub sas: Option, @@ -14802,12 +13658,6 @@ pub struct WorkspaceProperties { #[doc = "Enabling v1_legacy_mode may prevent you from using features provided by the v2 API."] #[serde(rename = "v1LegacyMode", default, skip_serializing_if = "Option::is_none")] pub v1_legacy_mode: Option, - #[doc = "The timestamp when the workspace was soft deleted"] - #[serde(rename = "softDeletedAt", default, skip_serializing_if = "Option::is_none")] - pub soft_deleted_at: Option, - #[doc = "The timestamp when the soft deleted workspace is going to be purged"] - #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")] - pub scheduled_purge_date: Option, } impl WorkspaceProperties { pub fn new() -> Self { @@ -14827,7 +13677,6 @@ pub mod workspace_properties { Succeeded, Failed, Canceled, - SoftDeleted, #[serde(skip_deserializing)] UnknownValue(String), } @@ -14860,7 +13709,6 @@ pub mod workspace_properties { Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), - Self::SoftDeleted => serializer.serialize_unit_variant("ProvisioningState", 7u32, "SoftDeleted"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -14929,8 +13777,6 @@ pub struct WorkspacePropertiesUpdateParameters { #[doc = "ARM id of the container registry associated with this workspace."] #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] pub container_registry: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encryption: Option, } impl WorkspacePropertiesUpdateParameters { pub fn new() -> Self { diff --git a/services/mgmt/machinelearningservices/src/package_preview_2023_04/mod.rs b/services/mgmt/machinelearningservices/src/package_preview_2023_04/mod.rs deleted file mode 100644 index f17c38a80b..0000000000 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_04/mod.rs +++ /dev/null @@ -1,30929 +0,0 @@ -#![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, - scopes: Vec, - pipeline: azure_core::Pipeline, -} -#[derive(Clone)] -pub struct ClientBuilder { - credential: std::sync::Arc, - endpoint: Option, - scopes: Option>, - 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) -> 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) -> 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) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into) -> 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 { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: std::sync::Arc) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into, - credential: std::sync::Arc, - scopes: Vec, - 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 batch_deployments_client(&self) -> batch_deployments::Client { - batch_deployments::Client(self.clone()) - } - pub fn batch_endpoints_client(&self) -> batch_endpoints::Client { - batch_endpoints::Client(self.clone()) - } - pub fn code_containers_client(&self) -> code_containers::Client { - code_containers::Client(self.clone()) - } - pub fn code_versions_client(&self) -> code_versions::Client { - code_versions::Client(self.clone()) - } - pub fn component_containers_client(&self) -> component_containers::Client { - component_containers::Client(self.clone()) - } - pub fn component_versions_client(&self) -> component_versions::Client { - component_versions::Client(self.clone()) - } - pub fn compute_client(&self) -> compute::Client { - compute::Client(self.clone()) - } - pub fn data_containers_client(&self) -> data_containers::Client { - data_containers::Client(self.clone()) - } - pub fn data_versions_client(&self) -> data_versions::Client { - data_versions::Client(self.clone()) - } - pub fn datastores_client(&self) -> datastores::Client { - datastores::Client(self.clone()) - } - pub fn environment_containers_client(&self) -> environment_containers::Client { - environment_containers::Client(self.clone()) - } - pub fn environment_versions_client(&self) -> environment_versions::Client { - environment_versions::Client(self.clone()) - } - pub fn features_client(&self) -> features::Client { - features::Client(self.clone()) - } - pub fn featureset_containers_client(&self) -> featureset_containers::Client { - featureset_containers::Client(self.clone()) - } - pub fn featureset_versions_client(&self) -> featureset_versions::Client { - featureset_versions::Client(self.clone()) - } - pub fn featurestore_entity_containers_client(&self) -> featurestore_entity_containers::Client { - featurestore_entity_containers::Client(self.clone()) - } - pub fn featurestore_entity_versions_client(&self) -> featurestore_entity_versions::Client { - featurestore_entity_versions::Client(self.clone()) - } - pub fn jobs_client(&self) -> jobs::Client { - jobs::Client(self.clone()) - } - pub fn labeling_jobs_client(&self) -> labeling_jobs::Client { - labeling_jobs::Client(self.clone()) - } - pub fn managed_network_provisions_client(&self) -> managed_network_provisions::Client { - managed_network_provisions::Client(self.clone()) - } - pub fn managed_network_settings_rule_client(&self) -> managed_network_settings_rule::Client { - managed_network_settings_rule::Client(self.clone()) - } - pub fn model_containers_client(&self) -> model_containers::Client { - model_containers::Client(self.clone()) - } - pub fn model_versions_client(&self) -> model_versions::Client { - model_versions::Client(self.clone()) - } - pub fn online_deployments_client(&self) -> online_deployments::Client { - online_deployments::Client(self.clone()) - } - pub fn online_endpoints_client(&self) -> online_endpoints::Client { - online_endpoints::Client(self.clone()) - } - pub fn operations_client(&self) -> operations::Client { - operations::Client(self.clone()) - } - pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { - private_endpoint_connections::Client(self.clone()) - } - pub fn private_link_resources_client(&self) -> private_link_resources::Client { - private_link_resources::Client(self.clone()) - } - pub fn quotas_client(&self) -> quotas::Client { - quotas::Client(self.clone()) - } - pub fn registries_client(&self) -> registries::Client { - registries::Client(self.clone()) - } - pub fn registry_code_containers_client(&self) -> registry_code_containers::Client { - registry_code_containers::Client(self.clone()) - } - pub fn registry_code_versions_client(&self) -> registry_code_versions::Client { - registry_code_versions::Client(self.clone()) - } - pub fn registry_component_containers_client(&self) -> registry_component_containers::Client { - registry_component_containers::Client(self.clone()) - } - pub fn registry_component_versions_client(&self) -> registry_component_versions::Client { - registry_component_versions::Client(self.clone()) - } - pub fn registry_data_containers_client(&self) -> registry_data_containers::Client { - registry_data_containers::Client(self.clone()) - } - pub fn registry_data_versions_client(&self) -> registry_data_versions::Client { - registry_data_versions::Client(self.clone()) - } - pub fn registry_environment_containers_client(&self) -> registry_environment_containers::Client { - registry_environment_containers::Client(self.clone()) - } - pub fn registry_environment_versions_client(&self) -> registry_environment_versions::Client { - registry_environment_versions::Client(self.clone()) - } - pub fn registry_model_containers_client(&self) -> registry_model_containers::Client { - registry_model_containers::Client(self.clone()) - } - pub fn registry_model_versions_client(&self) -> registry_model_versions::Client { - registry_model_versions::Client(self.clone()) - } - pub fn schedules_client(&self) -> schedules::Client { - schedules::Client(self.clone()) - } - pub fn usages_client(&self) -> usages::Client { - usages::Client(self.clone()) - } - pub fn virtual_machine_sizes_client(&self) -> virtual_machine_sizes::Client { - virtual_machine_sizes::Client(self.clone()) - } - pub fn workspace_connections_client(&self) -> workspace_connections::Client { - workspace_connections::Client(self.clone()) - } - pub fn workspace_features_client(&self) -> workspace_features::Client { - workspace_features::Client(self.clone()) - } - pub fn workspaces_client(&self) -> workspaces::Client { - workspaces::Client(self.clone()) - } -} -pub mod operations { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all of the available Azure Machine Learning Services REST API operations."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AmlOperationListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - } - impl RequestBuilder { - #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] - #[doc = ""] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.MachineLearningServices/operations", - self.client.endpoint(), - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod workspaces { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the properties of the specified machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Creates or updates a workspace with the specified parameters."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `parameters`: The parameters for creating or updating a machine learning workspace."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Updates a machine learning workspace with the specified parameters."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `parameters`: The parameters for updating a machine learning workspace."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - force_to_purge: None, - } - } - #[doc = "Lists all the available machine learning workspaces under the specified resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn list_by_resource_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> 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(), - skip: None, - kind: None, - } - } - #[doc = "Diagnose workspace setup issue."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn diagnose( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> diagnose::RequestBuilder { - diagnose::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - parameters: None, - } - } - #[doc = "Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn resync_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> resync_keys::RequestBuilder { - resync_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Lists all the available machine learning workspaces under the specified subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - skip: None, - kind: None, - } - } - #[doc = "return notebook access token and refresh token"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_notebook_access_token( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_notebook_access_token::RequestBuilder { - list_notebook_access_token::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Prepare a notebook."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn prepare_notebook( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> prepare_notebook::RequestBuilder { - prepare_notebook::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "List storage account keys of a workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_storage_account_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_storage_account_keys::RequestBuilder { - list_storage_account_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "List keys of a notebook."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_notebook_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_notebook_keys::RequestBuilder { - list_notebook_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_outbound_network_dependencies_endpoints( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_outbound_network_dependencies_endpoints::RequestBuilder { - list_outbound_network_dependencies_endpoints::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Workspace = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Workspace = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) parameters: models::Workspace, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Workspace = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) parameters: models::WorkspaceUpdateParameters, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) force_to_purge: Option, - } - impl RequestBuilder { - #[doc = "Flag to indicate delete is a purge request."] - pub fn force_to_purge(mut self, force_to_purge: bool) -> Self { - self.force_to_purge = Some(force_to_purge); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(force_to_purge) = &this.force_to_purge { - req.url_mut() - .query_pairs_mut() - .append_pair("forceToPurge", &force_to_purge.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_by_resource_group { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) skip: Option, - pub(crate) kind: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Kind of workspace."] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod diagnose { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) parameters: Option, - } - impl RequestBuilder { - #[doc = "The parameter of diagnosing workspace health"] - pub fn parameters(mut self, parameters: impl Into) -> Self { - self.parameters = Some(parameters.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = if let Some(parameters) = &this.parameters { - req.insert_header("content-type", "application/json"); - azure_core::to_json(parameters)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/diagnose", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListWorkspaceKeysResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod resync_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/resyncKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_by_subscription { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) skip: Option, - pub(crate) kind: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Kind of workspace."] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/workspaces", - self.client.endpoint(), - &self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_notebook_access_token { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NotebookAccessTokenResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookAccessToken" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod prepare_notebook { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NotebookResourceInfo = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/prepareNotebook", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod list_storage_account_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListStorageAccountKeysResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listStorageAccountKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_notebook_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListNotebookKeysResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_outbound_network_dependencies_endpoints { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExternalFqdnResponse = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundNetworkDependenciesEndpoints" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod usages { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the current usage information as well as limits for AML resources for given subscription and location."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `location`: The location for which resource usage is queried."] - pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - location: location.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListUsagesResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) location: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/usages", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod virtual_machine_sizes { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns supported VM Sizes in a location"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `location`: The location upon which virtual-machine-sizes is queried."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list(&self, location: impl Into, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - location: location.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::VirtualMachineSizeListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) location: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/vmSizes", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod quotas { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Update quota for each VM family in workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `location`: The location for update quota is queried."] - #[doc = "* `parameters`: Quota update parameters."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn update( - &self, - location: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - location: location.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the currently assigned Workspace Quotas based on VMFamily."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `location`: The location for which resource usage is queried."] - pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - location: location.into(), - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UpdateWorkspaceQuotasResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) location: String, - pub(crate) parameters: models::QuotaUpdateParameters, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/updateQuotas", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListWorkspaceQuotas = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) location: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/quotas", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod compute { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets computes in specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - } - } - #[doc = "Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: Payload with Machine Learning compute definition."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: Additional parameters for cluster update."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes specified Machine Learning compute."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `underlying_resource_action`: Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - underlying_resource_action: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - underlying_resource_action: underlying_resource_action.into(), - } - } - #[doc = "Updates the custom services list. The list of custom services provided shall be overwritten"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `custom_services`: New list of Custom Services."] - pub fn update_custom_services( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - custom_services: Vec, - ) -> update_custom_services::RequestBuilder { - update_custom_services::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - custom_services, - } - } - #[doc = "Get the details (e.g IP address, port etc) of all the compute nodes in the compute."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn list_nodes( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> list_nodes::RequestBuilder { - list_nodes::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Gets secrets related to Machine Learning compute (storage keys, service credentials, etc)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Posts a start action to a compute instance"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn start( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> start::RequestBuilder { - start::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Posts a stop action to a compute instance"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn stop( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> stop::RequestBuilder { - stop::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Posts a restart action to a compute instance"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn restart( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> restart::RequestBuilder { - restart::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Updates the idle shutdown setting of a compute instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: The object for updating idle shutdown setting of specified ComputeInstance."] - pub fn update_idle_shutdown_setting( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> update_idle_shutdown_setting::RequestBuilder { - update_idle_shutdown_setting::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PaginatedComputeResourcesList = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::ComputeResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::ClusterUpdateParameters, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) underlying_resource_action: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let underlying_resource_action = &this.underlying_resource_action; - req.url_mut() - .query_pairs_mut() - .append_pair("underlyingResourceAction", underlying_resource_action); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod update_custom_services { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) custom_services: Vec, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.custom_services)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/customServices" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_nodes { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AmlComputeNodesInformation = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - 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()), - ); - 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, "2023-04-01-preview"); - } - 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::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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listNodes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeSecretsUnion = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod start { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/start", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod stop { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/stop", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod restart { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/restart", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod update_idle_shutdown_setting { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::IdleShutdownSetting, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/updateIdleShutdownSetting" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod private_endpoint_connections { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List all the private endpoint connections associated with the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list( - &self, - resource_group_name: impl Into, - workspace_name: impl Into, - subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the specified private endpoint connection associated with the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - private_endpoint_connection_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - } - } - #[doc = "Update the state of specified private endpoint connection associated with the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] - #[doc = "* `properties`: The private endpoint connection properties."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - private_endpoint_connection_name: impl Into, - properties: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - properties: properties.into(), - } - } - #[doc = "Deletes the specified private endpoint connection associated with the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the workspace"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - private_endpoint_connection_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnectionListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - 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 = ""] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnection = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) private_endpoint_connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnection = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) private_endpoint_connection_name: String, - pub(crate) properties: models::PrivateEndpointConnection, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.properties)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) private_endpoint_connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod private_link_resources { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the private link resources that need to be created for a workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateLinkResourceListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateLinkResources", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod workspace_connections { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - } - } - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - #[doc = "* `parameters`: The object for creating or updating a new workspace connection"] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - parameters: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - } - } - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - target: None, - category: None, - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.connection_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - pub(crate) parameters: models::WorkspaceConnectionPropertiesV2BasicResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.connection_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.connection_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) target: Option, - pub(crate) category: Option, - } - impl RequestBuilder { - #[doc = "Target of the workspace connection."] - pub fn target(mut self, target: impl Into) -> Self { - self.target = Some(target.into()); - self - } - #[doc = "Category of the workspace connection."] - pub fn category(mut self, category: impl Into) -> Self { - self.category = Some(category.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable - { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(target) = &this.target { - req.url_mut().query_pairs_mut().append_pair("target", target); - } - if let Some(category) = &this.category { - req.url_mut().query_pairs_mut().append_pair("category", category); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod managed_network_settings_rule { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the managed network outbound rules for a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Gets an outbound rule from the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `rule_name`: Name of the workspace managed network outbound rule"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - rule_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - rule_name: rule_name.into(), - } - } - #[doc = "Creates or updates an outbound rule in the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `rule_name`: Name of the workspace managed network outbound rule"] - #[doc = "* `parameters`: Outbound Rule to be created or updated in the managed network of a machine learning workspace."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - rule_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - rule_name: rule_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes an outbound rule from the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `rule_name`: Name of the workspace managed network outbound rule"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - rule_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - rule_name: rule_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OutboundRuleListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OutboundRuleBasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) rule_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.rule_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) rule_name: String, - pub(crate) parameters: models::OutboundRuleBasicResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.rule_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) rule_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.rule_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod managed_network_provisions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provisions the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn provision_managed_network( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> provision_managed_network::RequestBuilder { - provision_managed_network::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - parameters: None, - } - } - } - pub mod provision_managed_network { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ManagedNetworkProvisionStatus = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) parameters: Option, - } - impl RequestBuilder { - #[doc = "Managed Network Provisioning Options for a machine learning workspace."] - pub fn parameters(mut self, parameters: impl Into) -> Self { - self.parameters = Some(parameters.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = if let Some(parameters) = &this.parameters { - req.insert_header("content-type", "application/json"); - azure_core::to_json(parameters)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/provisionManagedNetwork" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } -} -pub mod registry_code_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - } - } - #[doc = "Get Code container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - } - } - #[doc = "Create or update Code container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - body: body.into(), - } - } - #[doc = "Delete Code container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) body: models::CodeContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a code asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Pending upload name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . code_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod registry_component_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) body: models::ComponentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - order_by: None, - top: None, - skip: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Component stage."] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_data_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Data containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) body: models::DataContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_data_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data versions in the data container"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Data container's name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - tags: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a data asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Data asset name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod registry_environment_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List environment containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) body: models::EnvironmentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_environment_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_model_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - } - } - #[doc = "Create or update model container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) body: models::ModelContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_model_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - skip: None, - order_by: None, - top: None, - version: None, - description: None, - tags: None, - properties: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a model asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Model name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Version identifier."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . model_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod batch_endpoints { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference endpoint in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - count: None, - skip: None, - } - } - #[doc = "Gets a batch inference endpoint by name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Creates a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Batch inference endpoint definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Mutable batch inference endpoint definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Lists batch Inference Endpoint keys."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::BatchEndpointTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod batch_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference deployments in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Gets a batch inference deployment by id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch deployments."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Creates/updates a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: Inference deployment identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::BatchDeploymentTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::CodeContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - hash: None, - hash_version: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a code asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) hash: Option, - pub(crate) hash_version: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "If specified, return CodeVersion assets with specified content hash value, regardless of name"] - pub fn hash(mut self, hash: impl Into) -> Self { - self.hash = Some(hash.into()); - self - } - #[doc = "Hash algorithm version when listing by hash"] - pub fn hash_version(mut self, hash_version: impl Into) -> Self { - self.hash_version = Some(hash_version.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(hash) = &this.hash { - req.url_mut().query_pairs_mut().append_pair("hash", hash); - } - if let Some(hash_version) = &this.hash_version { - req.url_mut().query_pairs_mut().append_pair("hashVersion", hash_version); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod component_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List component containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ComponentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List component versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Component name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - stage: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) stage: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Component stage."] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod data_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::DataContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod data_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data versions in the data container"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Data container's name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - tags: None, - stage: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) stage: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "data stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod datastores { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List datastores."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - count: None, - is_default: None, - names: Vec::new(), - search_text: None, - order_by: None, - order_by_asc: None, - } - } - #[doc = "Get datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - #[doc = "* `body`: Datastore entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - skip_validation: None, - } - } - #[doc = "Delete datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Get datastore secrets."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn list_secrets( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) is_default: Option, - pub(crate) names: Vec, - pub(crate) search_text: Option, - pub(crate) order_by: Option, - pub(crate) order_by_asc: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Filter down to the workspace default datastore."] - pub fn is_default(mut self, is_default: bool) -> Self { - self.is_default = Some(is_default); - self - } - #[doc = "Names of datastores to return."] - pub fn names(mut self, names: Vec) -> Self { - self.names = names; - self - } - #[doc = "Text to search for in the datastore names."] - pub fn search_text(mut self, search_text: impl Into) -> Self { - self.search_text = Some(search_text.into()); - self - } - #[doc = "Order by property (createdtime | modifiedtime | name)."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Order by property in ascending order."] - pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { - self.order_by_asc = Some(order_by_asc); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(is_default) = &this.is_default { - req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); - } - if let Some(search_text) = &this.search_text { - req.url_mut().query_pairs_mut().append_pair("searchText", search_text); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); - } - if let Some(order_by_asc) = &this.order_by_asc { - req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::DatastoreResource, - pub(crate) skip_validation: Option, - } - impl RequestBuilder { - #[doc = "Flag to skip validation."] - pub fn skip_validation(mut self, skip_validation: bool) -> Self { - self.skip_validation = Some(skip_validation); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(skip_validation) = &this.skip_validation { - req.url_mut() - .query_pairs_mut() - .append_pair("skipValidation", &skip_validation.to_string()); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_secrets { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreSecretsUnion = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod environment_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List environment containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::EnvironmentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod environment_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Creates or updates an EnvironmentVersion."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] - #[doc = "* `version`: Version of EnvironmentVersion."] - #[doc = "* `body`: Definition of EnvironmentVersion."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featureset_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List featurestore entity containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - name: None, - description: None, - created_by: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get_entity( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get_entity::RequestBuilder { - get_entity::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) name: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featureset"] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "description for the feature set"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get_entity { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::FeaturesetContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod features { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Features."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `featureset_name`: Featureset name. This is case-sensitive."] - #[doc = "* `featureset_version`: Featureset Version identifier. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - featureset_name: impl Into, - featureset_version: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - featureset_name: featureset_name.into(), - featureset_version: featureset_version.into(), - skip: None, - tags: None, - feature_name: None, - description: None, - } - } - #[doc = "Get feature."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `featureset_name`: Feature set name. This is case-sensitive."] - #[doc = "* `featureset_version`: Feature set version identifier. This is case-sensitive."] - #[doc = "* `feature_name`: Feature Name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - featureset_name: impl Into, - featureset_version: impl Into, - feature_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - featureset_name: featureset_name.into(), - featureset_version: featureset_version.into(), - feature_name: feature_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeatureResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) featureset_name: String, - pub(crate) featureset_version: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) feature_name: Option, - pub(crate) description: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "feature name."] - pub fn feature_name(mut self, feature_name: impl Into) -> Self { - self.feature_name = Some(feature_name.into()); - self - } - #[doc = "Description of the featureset."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(feature_name) = &this.feature_name { - req.url_mut().query_pairs_mut().append_pair("featureName", feature_name); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/features" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . featureset_name , & self . featureset_version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeatureResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) featureset_name: String, - pub(crate) featureset_version: String, - pub(crate) feature_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/features/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . featureset_name , & self . featureset_version , & self . feature_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod featureset_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Featureset name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - version_name: None, - version: None, - description: None, - created_by: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Backfill."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Feature set version backfill request entity."] - pub fn backfill( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> backfill::RequestBuilder { - backfill::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "List materialization Jobs."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn list_materialization_jobs( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> list_materialization_jobs::RequestBuilder { - list_materialization_jobs::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - skip: None, - filters: None, - feature_window_start: None, - feature_window_end: None, - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) version_name: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featureset version"] - pub fn version_name(mut self, version_name: impl Into) -> Self { - self.version_name = Some(version_name.into()); - self - } - #[doc = "featureset version"] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "description for the feature set version"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - #[doc = "Specifies the featurestore stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(version_name) = &this.version_name { - req.url_mut().query_pairs_mut().append_pair("versionName", version_name); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturesetVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod backfill { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetJob = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturesetVersionBackfillRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/backfill" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod list_materialization_jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetJobArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) skip: Option, - pub(crate) filters: Option, - pub(crate) feature_window_start: Option, - pub(crate) feature_window_end: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn filters(mut self, filters: impl Into) -> Self { - self.filters = Some(filters.into()); - self - } - #[doc = "Start time of the feature window to filter materialization jobs."] - pub fn feature_window_start(mut self, feature_window_start: impl Into) -> Self { - self.feature_window_start = Some(feature_window_start.into()); - self - } - #[doc = "End time of the feature window to filter materialization jobs."] - pub fn feature_window_end(mut self, feature_window_end: impl Into) -> Self { - self.feature_window_end = Some(feature_window_end.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - 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()), - ); - 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, "2023-04-01-preview"); - } - 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::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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(filters) = &this.filters { - req.url_mut().query_pairs_mut().append_pair("filters", filters); - } - if let Some(feature_window_start) = &this.feature_window_start { - req.url_mut() - .query_pairs_mut() - .append_pair("featureWindowStart", feature_window_start); - } - if let Some(feature_window_end) = &this.feature_window_end { - req.url_mut().query_pairs_mut().append_pair("featureWindowEnd", feature_window_end); - } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/listMaterializationJobs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featurestore_entity_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List featurestore entity containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - name: None, - description: None, - created_by: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get_entity( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get_entity::RequestBuilder { - get_entity::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) name: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featurestore entity"] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "description for the featurestore entity"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get_entity { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::FeaturestoreEntityContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featurestore_entity_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Feature entity name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - version_name: None, - version: None, - description: None, - created_by: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) version_name: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featurestore entity version"] - pub fn version_name(mut self, version_name: impl Into) -> Self { - self.version_name = Some(version_name.into()); - self - } - #[doc = "featurestore entity version"] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "description for the feature entity version"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - #[doc = "Specifies the featurestore stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(version_name) = &this.version_name { - req.url_mut().query_pairs_mut().append_pair("versionName", version_name); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturestoreEntityVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Jobs in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - job_type: None, - tag: None, - list_view_type: None, - asset_name: None, - scheduled: None, - schedule_id: None, - } - } - #[doc = "Gets a Job by name/id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Creates and executes a Job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - #[doc = "* `body`: Job definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Updates a Job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - #[doc = "* `body`: Job definition to apply during the operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Deletes a Job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Cancels a Job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn cancel( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> cancel::RequestBuilder { - cancel::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) job_type: Option, - pub(crate) tag: Option, - pub(crate) list_view_type: Option, - pub(crate) asset_name: Option, - pub(crate) scheduled: Option, - pub(crate) schedule_id: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Type of job to be returned."] - pub fn job_type(mut self, job_type: impl Into) -> Self { - self.job_type = Some(job_type.into()); - self - } - #[doc = "Jobs returned will have this tag key."] - pub fn tag(mut self, tag: impl Into) -> Self { - self.tag = Some(tag.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "Asset name the job's named output is registered with"] - pub fn asset_name(mut self, asset_name: impl Into) -> Self { - self.asset_name = Some(asset_name.into()); - self - } - #[doc = "Indicator whether the job is scheduled job."] - pub fn scheduled(mut self, scheduled: bool) -> Self { - self.scheduled = Some(scheduled); - self - } - #[doc = "The scheduled id for listing the job triggered from"] - pub fn schedule_id(mut self, schedule_id: impl Into) -> Self { - self.schedule_id = Some(schedule_id.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(job_type) = &this.job_type { - req.url_mut().query_pairs_mut().append_pair("jobType", job_type); - } - if let Some(tag) = &this.tag { - req.url_mut().query_pairs_mut().append_pair("tag", tag); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(asset_name) = &this.asset_name { - req.url_mut().query_pairs_mut().append_pair("assetName", asset_name); - } - if let Some(scheduled) = &this.scheduled { - req.url_mut().query_pairs_mut().append_pair("scheduled", &scheduled.to_string()); - } - if let Some(schedule_id) = &this.schedule_id { - req.url_mut().query_pairs_mut().append_pair("scheduleId", schedule_id); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::JobBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::PartialJobBasePartialResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod cancel { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod labeling_jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists labeling jobs in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - top: None, - } - } - #[doc = "Gets a labeling job by name/id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - include_job_instructions: None, - include_label_categories: None, - } - } - #[doc = "Creates or updates a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: LabelingJob definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Delete a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Export labels from a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: The export summary."] - pub fn export_labels( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> export_labels::RequestBuilder { - export_labels::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Pause a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn pause( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> pause::RequestBuilder { - pause::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Resume a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn resume( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) top: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Number of labeling jobs to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) include_job_instructions: Option, - pub(crate) include_label_categories: Option, - } - impl RequestBuilder { - #[doc = "Boolean value to indicate whether to include JobInstructions in response."] - pub fn include_job_instructions(mut self, include_job_instructions: bool) -> Self { - self.include_job_instructions = Some(include_job_instructions); - self - } - #[doc = "Boolean value to indicate Whether to include LabelCategories in response."] - pub fn include_label_categories(mut self, include_label_categories: bool) -> Self { - self.include_label_categories = Some(include_label_categories); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(include_job_instructions) = &this.include_job_instructions { - req.url_mut() - .query_pairs_mut() - .append_pair("includeJobInstructions", &include_job_instructions.to_string()); - } - if let Some(include_label_categories) = &this.include_label_categories { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLabelCategories", &include_label_categories.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::LabelingJobResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod export_labels { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExportSummaryUnion = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::ExportSummaryUnion, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/exportLabels" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod pause { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/pause", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod resume { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/resume" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod model_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - count: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ModelContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod model_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Model name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - order_by: None, - top: None, - version: None, - description: None, - offset: None, - tags: None, - properties: None, - feed: None, - stage: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Model Version Package operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Package operation request body."] - pub fn package( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> package::RequestBuilder { - package::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) offset: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) feed: Option, - pub(crate) stage: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Model version."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Number of initial results to skip."] - pub fn offset(mut self, offset: i32) -> Self { - self.offset = Some(offset); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "Name of the feed."] - pub fn feed(mut self, feed: impl Into) -> Self { - self.feed = Some(feed.into()); - self - } - #[doc = "Model stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(offset) = &this.offset { - req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(feed) = &this.feed { - req.url_mut().query_pairs_mut().append_pair("feed", feed); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod package { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageResponse = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::PackageRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}/package" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } -} -pub mod online_endpoints { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Online Endpoints."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: None, - count: None, - compute_type: None, - skip: None, - tags: None, - properties: None, - order_by: None, - } - } - #[doc = "Get Online Endpoint."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Create or update Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Delete Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: RegenerateKeys request ."] - pub fn regenerate_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> regenerate_keys::RequestBuilder { - regenerate_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Retrieve a valid AML token for an Endpoint using AMLToken-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn get_token( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get_token::RequestBuilder { - get_token::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: Option, - pub(crate) count: Option, - pub(crate) compute_type: Option, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) order_by: Option, - } - impl RequestBuilder { - #[doc = "Name of the endpoint."] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "EndpointComputeType to be filtered by."] - pub fn compute_type(mut self, compute_type: impl Into) -> Self { - self.compute_type = Some(compute_type.into()); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "The option to order the response."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(compute_type) = &this.compute_type { - req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::OnlineEndpointTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod regenerate_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::RegenerateEndpointKeysRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get_token { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthToken = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod online_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Inference Endpoint Deployments."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get Inference Deployment Deployment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Inference Endpoint entity to apply during operation."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Polls an Endpoint operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: The name and identifier for the endpoint."] - #[doc = "* `body`: The request containing parameters for retrieving logs."] - pub fn get_logs( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> get_logs::RequestBuilder { - get_logs::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "List Inference Endpoint Deployment Skus."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn list_skus( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> list_skus::RequestBuilder { - list_skus::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - count: None, - skip: None, - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::OnlineDeploymentTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithSku, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get_logs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentLogs = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::DeploymentLogsRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_skus { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SkuResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Number of Skus to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod schedules { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List schedules in specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - #[doc = "* `body`: Schedule definition."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Status filter for schedule."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ScheduleResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registries { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List registries by subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "List registries"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - } - } - #[doc = "Get registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - } - } - #[doc = "Create or update registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - #[doc = "Update tags"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - #[doc = "Delete registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - } - } - #[doc = "Remove regions from registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn remove_regions( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> remove_regions::RequestBuilder { - remove_regions::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - } - pub mod list_by_subscription { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::RegistryTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::AzureAsyncOperation)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::PartialRegistryPartialTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } - pub mod remove_regions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::RegistryTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/removeRegions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } -} -pub mod workspace_features { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all enabled features for a workspace"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListAmlUserFeatureResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-04-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/features", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); - } - Ok(url) - } - } - } -} diff --git a/services/mgmt/machinelearningservices/src/package_preview_2023_04/models.rs b/services/mgmt/machinelearningservices/src/package_preview_2023_04/models.rs deleted file mode 100644 index af84166ac3..0000000000 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_04/models.rs +++ /dev/null @@ -1,19553 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "A Machine Learning compute based on AKS."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Aks { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub aks_schema: AksSchema, -} -impl Aks { - pub fn new(compute: Compute) -> Self { - Self { - compute, - aks_schema: AksSchema::default(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AksSchema { - #[doc = "AKS properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl AksSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod aks_schema { - use super::*; - #[doc = "AKS properties"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Cluster full qualified domain name"] - #[serde(rename = "clusterFqdn", default, skip_serializing_if = "Option::is_none")] - pub cluster_fqdn: Option, - #[doc = "System services"] - #[serde( - rename = "systemServices", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub system_services: Vec, - #[doc = "Number of agents"] - #[serde(rename = "agentCount", default, skip_serializing_if = "Option::is_none")] - pub agent_count: Option, - #[doc = "Agent virtual machine size"] - #[serde(rename = "agentVmSize", default, skip_serializing_if = "Option::is_none")] - pub agent_vm_size: Option, - #[doc = "Intended usage of the cluster"] - #[serde(rename = "clusterPurpose", default, skip_serializing_if = "Option::is_none")] - pub cluster_purpose: Option, - #[doc = "The ssl configuration for scoring"] - #[serde(rename = "sslConfiguration", default, skip_serializing_if = "Option::is_none")] - pub ssl_configuration: Option, - #[doc = "Advance configuration for AKS networking"] - #[serde(rename = "aksNetworkingConfiguration", default, skip_serializing_if = "Option::is_none")] - pub aks_networking_configuration: Option, - #[doc = "Load Balancer Type"] - #[serde(rename = "loadBalancerType", default, skip_serializing_if = "Option::is_none")] - pub load_balancer_type: Option, - #[doc = "Load Balancer Subnet"] - #[serde(rename = "loadBalancerSubnet", default, skip_serializing_if = "Option::is_none")] - pub load_balancer_subnet: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } - pub mod properties { - use super::*; - #[doc = "Intended usage of the cluster"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ClusterPurpose")] - pub enum ClusterPurpose { - FastProd, - DenseProd, - DevTest, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ClusterPurpose { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ClusterPurpose { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ClusterPurpose { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::FastProd => serializer.serialize_unit_variant("ClusterPurpose", 0u32, "FastProd"), - Self::DenseProd => serializer.serialize_unit_variant("ClusterPurpose", 1u32, "DenseProd"), - Self::DevTest => serializer.serialize_unit_variant("ClusterPurpose", 2u32, "DevTest"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for ClusterPurpose { - fn default() -> Self { - Self::FastProd - } - } - #[doc = "Load Balancer Type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LoadBalancerType")] - pub enum LoadBalancerType { - PublicIp, - InternalLoadBalancer, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LoadBalancerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LoadBalancerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LoadBalancerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::PublicIp => serializer.serialize_unit_variant("LoadBalancerType", 0u32, "PublicIp"), - Self::InternalLoadBalancer => serializer.serialize_unit_variant("LoadBalancerType", 1u32, "InternalLoadBalancer"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for LoadBalancerType { - fn default() -> Self { - Self::PublicIp - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccessKeyAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl AccessKeyAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Account key datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccountKeyDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Datastore account key secrets."] - pub secrets: AccountKeyDatastoreSecrets, -} -impl AccountKeyDatastoreCredentials { - pub fn new(datastore_credentials: DatastoreCredentials, secrets: AccountKeyDatastoreSecrets) -> Self { - Self { - datastore_credentials, - secrets, - } - } -} -#[doc = "Datastore account key secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccountKeyDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Storage account key."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option, -} -impl AccountKeyDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - key: None, - } - } -} -#[doc = "Details of ACR account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AcrDetails { - #[serde(rename = "systemCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_acr_account: Option, - #[serde(rename = "userCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_acr_account: Option, -} -impl AcrDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Secrets related to a Machine Learning compute based on AKS."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AksComputeSecrets { - #[serde(flatten)] - pub compute_secrets: ComputeSecrets, - #[serde(flatten)] - pub aks_compute_secrets_properties: AksComputeSecretsProperties, -} -impl AksComputeSecrets { - pub fn new(compute_secrets: ComputeSecrets) -> Self { - Self { - compute_secrets, - aks_compute_secrets_properties: AksComputeSecretsProperties::default(), - } - } -} -#[doc = "Properties of AksComputeSecrets"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AksComputeSecretsProperties { - #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] - #[serde(rename = "userKubeConfig", default, skip_serializing_if = "Option::is_none")] - pub user_kube_config: Option, - #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] - #[serde(rename = "adminKubeConfig", default, skip_serializing_if = "Option::is_none")] - pub admin_kube_config: Option, - #[doc = "Image registry pull secret."] - #[serde(rename = "imagePullSecretName", default, skip_serializing_if = "Option::is_none")] - pub image_pull_secret_name: Option, -} -impl AksComputeSecretsProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Advance configuration for AKS networking"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AksNetworkingConfiguration { - #[doc = "Virtual network subnet resource ID the compute nodes belong to"] - #[serde(rename = "subnetId", default, skip_serializing_if = "Option::is_none")] - pub subnet_id: Option, - #[doc = "A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges."] - #[serde(rename = "serviceCidr", default, skip_serializing_if = "Option::is_none")] - pub service_cidr: Option, - #[doc = "An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr."] - #[serde(rename = "dnsServiceIP", default, skip_serializing_if = "Option::is_none")] - pub dns_service_ip: Option, - #[doc = "A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range."] - #[serde(rename = "dockerBridgeCidr", default, skip_serializing_if = "Option::is_none")] - pub docker_bridge_cidr: Option, -} -impl AksNetworkingConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AllFeatures { - #[serde(flatten)] - pub monitoring_feature_filter_base: MonitoringFeatureFilterBase, -} -impl AllFeatures { - pub fn new(monitoring_feature_filter_base: MonitoringFeatureFilterBase) -> Self { - Self { - monitoring_feature_filter_base, - } - } -} -#[doc = "All nodes means the service will be running on all of the nodes of the job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AllNodes { - #[serde(flatten)] - pub nodes: Nodes, -} -impl AllNodes { - pub fn new(nodes: Nodes) -> Self { - Self { nodes } - } -} -#[doc = "An Azure Machine Learning compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AmlCompute { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub aml_compute_schema: AmlComputeSchema, -} -impl AmlCompute { - pub fn new(compute: Compute) -> Self { - Self { - compute, - aml_compute_schema: AmlComputeSchema::default(), - } - } -} -#[doc = "Compute node information related to a AmlCompute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeNodeInformation { - #[doc = "ID of the compute node."] - #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")] - pub node_id: Option, - #[doc = "Private IP address of the compute node."] - #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] - pub private_ip_address: Option, - #[doc = "Public IP address of the compute node."] - #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] - pub public_ip_address: Option, - #[doc = "SSH port number of the node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] - #[serde(rename = "nodeState", default, skip_serializing_if = "Option::is_none")] - pub node_state: Option, - #[doc = "ID of the Experiment running on the node, if any else null."] - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option, -} -impl AmlComputeNodeInformation { - pub fn new() -> Self { - Self::default() - } -} -pub mod aml_compute_node_information { - use super::*; - #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "NodeState")] - pub enum NodeState { - #[serde(rename = "idle")] - Idle, - #[serde(rename = "running")] - Running, - #[serde(rename = "preparing")] - Preparing, - #[serde(rename = "unusable")] - Unusable, - #[serde(rename = "leaving")] - Leaving, - #[serde(rename = "preempted")] - Preempted, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for NodeState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for NodeState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for NodeState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Idle => serializer.serialize_unit_variant("NodeState", 0u32, "idle"), - Self::Running => serializer.serialize_unit_variant("NodeState", 1u32, "running"), - Self::Preparing => serializer.serialize_unit_variant("NodeState", 2u32, "preparing"), - Self::Unusable => serializer.serialize_unit_variant("NodeState", 3u32, "unusable"), - Self::Leaving => serializer.serialize_unit_variant("NodeState", 4u32, "leaving"), - Self::Preempted => serializer.serialize_unit_variant("NodeState", 5u32, "preempted"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Result of AmlCompute Nodes"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeNodesInformation { - #[doc = "The collection of returned AmlCompute nodes details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub nodes: Vec, - #[doc = "The continuation token."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for AmlComputeNodesInformation { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl AmlComputeNodesInformation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AML Compute properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeProperties { - #[doc = "Compute OS Type"] - #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] - pub os_type: Option, - #[doc = "Virtual Machine Size"] - #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] - pub vm_size: Option, - #[doc = "Virtual Machine priority"] - #[serde(rename = "vmPriority", default, skip_serializing_if = "Option::is_none")] - pub vm_priority: Option, - #[doc = "Virtual Machine image for Windows AML Compute"] - #[serde(rename = "virtualMachineImage", default, skip_serializing_if = "Option::is_none")] - pub virtual_machine_image: Option, - #[doc = "Network is isolated or not"] - #[serde(rename = "isolatedNetwork", default, skip_serializing_if = "Option::is_none")] - pub isolated_network: Option, - #[doc = "scale settings for AML Compute"] - #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, - #[doc = "Settings for user account that gets created on each on the nodes of a compute."] - #[serde(rename = "userAccountCredentials", default, skip_serializing_if = "Option::is_none")] - pub user_account_credentials: Option, - #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subnet: Option, - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] - #[serde(rename = "remoteLoginPortPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub remote_login_port_public_access: Option, - #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] - #[serde(rename = "allocationState", default, skip_serializing_if = "Option::is_none")] - pub allocation_state: Option, - #[doc = "The time at which the compute entered its current allocation state."] - #[serde(rename = "allocationStateTransitionTime", default, with = "azure_core::date::rfc3339::option")] - pub allocation_state_transition_time: Option, - #[doc = "Collection of errors encountered by various compute nodes during node setup."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub errors: Vec, - #[doc = "The number of compute nodes currently assigned to the compute."] - #[serde(rename = "currentNodeCount", default, skip_serializing_if = "Option::is_none")] - pub current_node_count: Option, - #[doc = "The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation."] - #[serde(rename = "targetNodeCount", default, skip_serializing_if = "Option::is_none")] - pub target_node_count: Option, - #[doc = "Counts of various compute node states on the amlCompute."] - #[serde(rename = "nodeStateCounts", default, skip_serializing_if = "Option::is_none")] - pub node_state_counts: Option, - #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] - #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] - pub enable_node_public_ip: Option, - #[doc = "A property bag containing additional properties."] - #[serde(rename = "propertyBag", default, skip_serializing_if = "Option::is_none")] - pub property_bag: Option, -} -impl AmlComputeProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod aml_compute_properties { - use super::*; - #[doc = "Compute OS Type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OsType")] - pub enum OsType { - Linux, - Windows, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), - Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for OsType { - fn default() -> Self { - Self::Linux - } - } - #[doc = "Virtual Machine priority"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "VmPriority")] - pub enum VmPriority { - Dedicated, - LowPriority, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for VmPriority { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for VmPriority { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for VmPriority { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dedicated => serializer.serialize_unit_variant("VmPriority", 0u32, "Dedicated"), - Self::LowPriority => serializer.serialize_unit_variant("VmPriority", 1u32, "LowPriority"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "RemoteLoginPortPublicAccess")] - pub enum RemoteLoginPortPublicAccess { - Enabled, - Disabled, - NotSpecified, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for RemoteLoginPortPublicAccess { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for RemoteLoginPortPublicAccess { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for RemoteLoginPortPublicAccess { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 1u32, "Disabled"), - Self::NotSpecified => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 2u32, "NotSpecified"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for RemoteLoginPortPublicAccess { - fn default() -> Self { - Self::NotSpecified - } - } - #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "AllocationState")] - pub enum AllocationState { - Steady, - Resizing, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for AllocationState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for AllocationState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for AllocationState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Steady => serializer.serialize_unit_variant("AllocationState", 0u32, "Steady"), - Self::Resizing => serializer.serialize_unit_variant("AllocationState", 1u32, "Resizing"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Properties(top level) of AmlCompute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeSchema { - #[doc = "AML Compute properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl AmlComputeSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Machine Learning REST API operation"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlOperation { - #[doc = "Operation name: {provider}/{resource}/{operation}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Display name of operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, - #[doc = "Indicates whether the operation applies to data-plane"] - #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] - pub is_data_action: Option, -} -impl AmlOperation { - pub fn new() -> Self { - Self::default() - } -} -pub mod aml_operation { - use super::*; - #[doc = "Display name of operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Display { - #[doc = "The resource provider name: Microsoft.MachineLearningExperimentation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[doc = "The resource on which the operation is performed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[doc = "The operation that users can perform."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, - #[doc = "The description for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - } - impl Display { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "An array of operations supported by the resource provider."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlOperationListResult { - #[doc = "List of AML operations supported by the AML resource provider."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for AmlOperationListResult { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl AmlOperationListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AML Token identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AmlToken { - #[serde(flatten)] - pub identity_configuration: IdentityConfiguration, -} -impl AmlToken { - pub fn new(identity_configuration: IdentityConfiguration) -> Self { - Self { identity_configuration } - } -} -#[doc = "Features enabled for a workspace"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlUserFeature { - #[doc = "Specifies the feature ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Specifies the feature name "] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Describes the feature for user experience"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl AmlUserFeature { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "ARM ResourceId of a resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArmResourceId { - #[doc = "Arm ResourceId is in the format \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}\"\r\nor \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}\""] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl ArmResourceId { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AssetBase { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[serde(rename = "autoDeleteSetting", default, skip_serializing_if = "Option::is_none")] - pub auto_delete_setting: Option, - #[doc = "If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous"] - #[serde(rename = "isAnonymous", default, skip_serializing_if = "Option::is_none")] - pub is_anonymous: Option, - #[doc = "Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived"] - #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] - pub is_archived: Option, -} -impl AssetBase { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AssetContainer { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "Is the asset archived?"] - #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] - pub is_archived: Option, - #[doc = "The latest version inside this container."] - #[serde(rename = "latestVersion", default, skip_serializing_if = "Option::is_none")] - pub latest_version: Option, - #[doc = "The next auto incremental version"] - #[serde(rename = "nextVersion", default, skip_serializing_if = "Option::is_none")] - pub next_version: Option, -} -impl AssetContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Asset input type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssetJobInput { - #[doc = "Enum to determine the input data delivery mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "[Required] Input Asset URI."] - pub uri: String, -} -impl AssetJobInput { - pub fn new(uri: String) -> Self { - Self { mode: None, uri } - } -} -#[doc = "Asset output type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AssetJobOutput { - #[doc = "Output Asset Name."] - #[serde(rename = "assetName", default, skip_serializing_if = "Option::is_none")] - pub asset_name: Option, - #[doc = "Output Asset Version."] - #[serde(rename = "assetVersion", default, skip_serializing_if = "Option::is_none")] - pub asset_version: Option, - #[serde(rename = "autoDeleteSetting", default, skip_serializing_if = "Option::is_none")] - pub auto_delete_setting: Option, - #[doc = "Output data delivery mode enums."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Output Asset URI."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, -} -impl AssetJobOutput { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Provisioning state of registry asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AssetProvisioningState")] -pub enum AssetProvisioningState { - Succeeded, - Failed, - Canceled, - Creating, - Updating, - Deleting, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AssetProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AssetProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AssetProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("AssetProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("AssetProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("AssetProvisioningState", 2u32, "Canceled"), - Self::Creating => serializer.serialize_unit_variant("AssetProvisioningState", 3u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("AssetProvisioningState", 4u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("AssetProvisioningState", 5u32, "Deleting"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition for asset references."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssetReferenceBase { - #[doc = "Enum to determine which reference method to use for an asset."] - #[serde(rename = "referenceType")] - pub reference_type: ReferenceType, -} -impl AssetReferenceBase { - pub fn new(reference_type: ReferenceType) -> Self { - Self { reference_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "referenceType")] -pub enum AssetReferenceBaseUnion { - DataPath(DataPathAssetReference), - Id(IdAssetReference), - OutputPath(OutputPathAssetReference), -} -#[doc = "A user that can be assigned to a compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssignedUser { - #[doc = "User’s AAD Object Id."] - #[serde(rename = "objectId")] - pub object_id: String, - #[doc = "User’s AAD Tenant Id."] - #[serde(rename = "tenantId")] - pub tenant_id: String, -} -impl AssignedUser { - pub fn new(object_id: String, tenant_id: String) -> Self { - Self { object_id, tenant_id } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AutoDeleteCondition")] -pub enum AutoDeleteCondition { - CreatedGreaterThan, - LastAccessedGreaterThan, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AutoDeleteCondition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AutoDeleteCondition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AutoDeleteCondition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreatedGreaterThan => serializer.serialize_unit_variant("AutoDeleteCondition", 0u32, "CreatedGreaterThan"), - Self::LastAccessedGreaterThan => serializer.serialize_unit_variant("AutoDeleteCondition", 1u32, "LastAccessedGreaterThan"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AutoDeleteSetting { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option, - #[doc = "Expiration condition value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl AutoDeleteSetting { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecast horizon determined automatically by system."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoForecastHorizon { - #[serde(flatten)] - pub forecast_horizon: ForecastHorizon, -} -impl AutoForecastHorizon { - pub fn new(forecast_horizon: ForecastHorizon) -> Self { - Self { forecast_horizon } - } -} -#[doc = "AutoMLJob class.\r\nUse this class for executing AutoML tasks like Classification/Regression etc.\r\nSee TaskType enum for all the tasks supported."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoMlJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "The ARM resource ID of the Environment specification for the job.\r\nThis is optional value to provide, if not provided, AutoML will default this to Production AutoML curated environment version when running the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Environment variables included in the job."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, - #[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] - #[serde(rename = "taskDetails")] - pub task_details: AutoMlVerticalUnion, -} -impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVerticalUnion) -> Self { - Self { - job_base, - environment_id: None, - environment_variables: None, - outputs: None, - queue_settings: None, - resources: None, - task_details, - } - } -} -#[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoMlVertical { - #[doc = "Enum for setting log verbosity."] - #[serde(rename = "logVerbosity", default, skip_serializing_if = "Option::is_none")] - pub log_verbosity: Option, - #[doc = "Target column name: This is prediction values column.\r\nAlso known as label column name in context of classification tasks."] - #[serde(rename = "targetColumnName", default, skip_serializing_if = "Option::is_none")] - pub target_column_name: Option, - #[doc = "AutoMLJob Task type."] - #[serde(rename = "taskType")] - pub task_type: TaskType, - #[serde(rename = "trainingData")] - pub training_data: MlTableJobInput, -} -impl AutoMlVertical { - pub fn new(task_type: TaskType, training_data: MlTableJobInput) -> Self { - Self { - log_verbosity: None, - target_column_name: None, - task_type, - training_data, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "taskType")] -pub enum AutoMlVerticalUnion { - Classification(Classification), - Forecasting(Forecasting), - ImageClassification(ImageClassification), - ImageClassificationMultilabel(ImageClassificationMultilabel), - ImageInstanceSegmentation(ImageInstanceSegmentation), - ImageObjectDetection(ImageObjectDetection), - Regression(Regression), - TextClassification(TextClassification), - TextClassificationMultilabel(TextClassificationMultilabel), - #[serde(rename = "TextNER")] - TextNer(TextNer), -} -#[doc = "N-Cross validations determined automatically."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoNCrossValidations { - #[serde(flatten)] - pub n_cross_validations: NCrossValidations, -} -impl AutoNCrossValidations { - pub fn new(n_cross_validations: NCrossValidations) -> Self { - Self { n_cross_validations } - } -} -#[doc = "Auto pause properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AutoPauseProperties { - #[serde(rename = "delayInMinutes", default, skip_serializing_if = "Option::is_none")] - pub delay_in_minutes: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} -impl AutoPauseProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AutoRebuild setting for the derived image"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AutoRebuildSetting")] -pub enum AutoRebuildSetting { - Disabled, - OnBaseImageUpdate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AutoRebuildSetting { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AutoRebuildSetting { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AutoRebuildSetting { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("AutoRebuildSetting", 0u32, "Disabled"), - Self::OnBaseImageUpdate => serializer.serialize_unit_variant("AutoRebuildSetting", 1u32, "OnBaseImageUpdate"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Auto scale properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AutoScaleProperties { - #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] - pub min_node_count: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "maxNodeCount", default, skip_serializing_if = "Option::is_none")] - pub max_node_count: Option, -} -impl AutoScaleProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoSeasonality { - #[serde(flatten)] - pub seasonality: Seasonality, -} -impl AutoSeasonality { - pub fn new(seasonality: Seasonality) -> Self { - Self { seasonality } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoTargetLags { - #[serde(flatten)] - pub target_lags: TargetLags, -} -impl AutoTargetLags { - pub fn new(target_lags: TargetLags) -> Self { - Self { target_lags } - } -} -#[doc = "Target lags rolling window determined automatically."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoTargetRollingWindowSize { - #[serde(flatten)] - pub target_rolling_window_size: TargetRollingWindowSize, -} -impl AutoTargetRollingWindowSize { - pub fn new(target_rolling_window_size: TargetRollingWindowSize) -> Self { - Self { - target_rolling_window_size, - } - } -} -#[doc = "Settings for Autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutologgerSettings { - #[doc = "Enum to determine the state of mlflow autologger."] - #[serde(rename = "mlflowAutologger")] - pub mlflow_autologger: MlFlowAutologgerState, -} -impl AutologgerSettings { - pub fn new(mlflow_autologger: MlFlowAutologgerState) -> Self { - Self { mlflow_autologger } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzMonMonitoringAlertNotificationSettings { - #[serde(flatten)] - pub monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase, -} -impl AzMonMonitoringAlertNotificationSettings { - pub fn new(monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase) -> Self { - Self { - monitoring_alert_notification_settings_base, - } - } -} -#[doc = "Azure Blob datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureBlobDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "Storage account name."] - #[serde(rename = "accountName", default, skip_serializing_if = "Option::is_none")] - pub account_name: Option, - #[doc = "Storage account container name."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "Azure cloud endpoint for the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "Protocol used to communicate with the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl AzureBlobDatastore { - pub fn new(datastore: Datastore) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - account_name: None, - container_name: None, - endpoint: None, - protocol: None, - service_data_access_auth_identity: None, - } - } -} -#[doc = "Azure Data Lake Gen1 datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDataLakeGen1Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, - #[doc = "[Required] Azure Data Lake store name."] - #[serde(rename = "storeName")] - pub store_name: String, -} -impl AzureDataLakeGen1Datastore { - pub fn new(datastore: Datastore, store_name: String) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - service_data_access_auth_identity: None, - store_name, - } - } -} -#[doc = "Azure Data Lake Gen2 datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDataLakeGen2Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "[Required] Storage account name."] - #[serde(rename = "accountName")] - pub account_name: String, - #[doc = "Azure cloud endpoint for the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "[Required] The name of the Data Lake Gen2 filesystem."] - pub filesystem: String, - #[doc = "Protocol used to communicate with the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl AzureDataLakeGen2Datastore { - pub fn new(datastore: Datastore, account_name: String, filesystem: String) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - account_name, - endpoint: None, - filesystem, - protocol: None, - service_data_access_auth_identity: None, - } - } -} -#[doc = "Base definition for Azure datastore contents configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureDatastore { - #[doc = "Azure Resource Group name"] - #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] - pub resource_group: Option, - #[doc = "Azure Subscription Id"] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, -} -impl AzureDatastore { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Webhook details specific for Azure DevOps"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDevOpsWebhook { - #[serde(flatten)] - pub webhook: Webhook, -} -impl AzureDevOpsWebhook { - pub fn new(webhook: Webhook) -> Self { - Self { webhook } - } -} -#[doc = "Azure File datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureFileDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "[Required] Storage account name."] - #[serde(rename = "accountName")] - pub account_name: String, - #[doc = "Azure cloud endpoint for the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "[Required] The name of the Azure file share that the datastore points to."] - #[serde(rename = "fileShareName")] - pub file_share_name: String, - #[doc = "Protocol used to communicate with the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl AzureFileDatastore { - pub fn new(datastore: Datastore, account_name: String, file_share_name: String) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - account_name, - endpoint: None, - file_share_name, - protocol: None, - service_data_access_auth_identity: None, - } - } -} -#[doc = "Azure ML batch inferencing server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureMlBatchInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, -} -impl AzureMlBatchInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - code_configuration: None, - } - } -} -#[doc = "Azure ML online inferencing configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureMlOnlineInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, -} -impl AzureMlOnlineInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - code_configuration: None, - } - } -} -#[doc = "Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BanditPolicy { - #[serde(flatten)] - pub early_termination_policy: EarlyTerminationPolicy, - #[doc = "Absolute distance allowed from the best performing run."] - #[serde(rename = "slackAmount", default, skip_serializing_if = "Option::is_none")] - pub slack_amount: Option, - #[doc = "Ratio of the allowed distance from the best performing run."] - #[serde(rename = "slackFactor", default, skip_serializing_if = "Option::is_none")] - pub slack_factor: Option, -} -impl BanditPolicy { - pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { - Self { - early_termination_policy, - slack_amount: None, - slack_factor: None, - } - } -} -#[doc = "Base environment type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BaseEnvironmentId { - #[serde(flatten)] - pub base_environment_source: BaseEnvironmentSource, - #[doc = "[Required] Resource id accepting ArmId or AzureMlId."] - #[serde(rename = "resourceId")] - pub resource_id: String, -} -impl BaseEnvironmentId { - pub fn new(base_environment_source: BaseEnvironmentSource, resource_id: String) -> Self { - Self { - base_environment_source, - resource_id, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BaseEnvironmentSource { - #[doc = "Base environment type."] - #[serde(rename = "baseEnvironmentSourceType")] - pub base_environment_source_type: BaseEnvironmentSourceType, -} -impl BaseEnvironmentSource { - pub fn new(base_environment_source_type: BaseEnvironmentSourceType) -> Self { - Self { - base_environment_source_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "baseEnvironmentSourceType")] -pub enum BaseEnvironmentSourceUnion { - EnvironmentAsset(BaseEnvironmentId), -} -#[doc = "Base environment type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BaseEnvironmentSourceType")] -pub enum BaseEnvironmentSourceType { - EnvironmentAsset, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BaseEnvironmentSourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BaseEnvironmentSourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BaseEnvironmentSourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::EnvironmentAsset => serializer.serialize_unit_variant("BaseEnvironmentSourceType", 0u32, "EnvironmentAsset"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Batch inference settings per deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchDeployment { - #[serde(flatten)] - pub endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase, - #[doc = "Compute target for batch inference operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compute: Option, - #[doc = "Properties relevant to different deployment types."] - #[serde(rename = "deploymentConfiguration", default, skip_serializing_if = "Option::is_none")] - pub deployment_configuration: Option, - #[doc = "Error threshold, if the error count for the entire input goes above this value,\r\nthe batch inference will be aborted. Range is [-1, int.MaxValue].\r\nFor FileDataset, this value is the count of file failures.\r\nFor TabularDataset, this value is the count of record failures.\r\nIf set to -1 (the lower bound), all failures during batch inference will be ignored."] - #[serde(rename = "errorThreshold", default, skip_serializing_if = "Option::is_none")] - pub error_threshold: Option, - #[doc = "Log verbosity for batch inferencing.\r\nIncreasing verbosity order for logging is : Warning, Info and Debug.\r\nThe default value is Info."] - #[serde(rename = "loggingLevel", default, skip_serializing_if = "Option::is_none")] - pub logging_level: Option, - #[doc = "Indicates maximum number of parallelism per instance."] - #[serde(rename = "maxConcurrencyPerInstance", default, skip_serializing_if = "Option::is_none")] - pub max_concurrency_per_instance: Option, - #[doc = "Size of the mini-batch passed to each batch invocation.\r\nFor FileDataset, this is the number of files per mini-batch.\r\nFor TabularDataset, this is the size of the records in bytes, per mini-batch."] - #[serde(rename = "miniBatchSize", default, skip_serializing_if = "Option::is_none")] - pub mini_batch_size: Option, - #[doc = "Base definition for asset references."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, - #[doc = "Enum to determine how batch inferencing will handle output"] - #[serde(rename = "outputAction", default, skip_serializing_if = "Option::is_none")] - pub output_action: Option, - #[doc = "Customized output file name for append_row output action."] - #[serde(rename = "outputFileName", default, skip_serializing_if = "Option::is_none")] - pub output_file_name: Option, - #[doc = "Possible values for DeploymentProvisioningState."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, - #[doc = "Retry settings for a batch inference operation."] - #[serde(rename = "retrySettings", default, skip_serializing_if = "Option::is_none")] - pub retry_settings: Option, -} -impl BatchDeployment { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties relevant to different deployment types."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchDeploymentConfiguration { - #[doc = "The enumerated property types for batch deployments."] - #[serde(rename = "deploymentConfigurationType")] - pub deployment_configuration_type: BatchDeploymentConfigurationType, -} -impl BatchDeploymentConfiguration { - pub fn new(deployment_configuration_type: BatchDeploymentConfigurationType) -> Self { - Self { - deployment_configuration_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "deploymentConfigurationType")] -pub enum BatchDeploymentConfigurationUnion { - PipelineComponent(BatchPipelineComponentDeploymentConfiguration), -} -#[doc = "The enumerated property types for batch deployments."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BatchDeploymentConfigurationType")] -pub enum BatchDeploymentConfigurationType { - Model, - PipelineComponent, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BatchDeploymentConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BatchDeploymentConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BatchDeploymentConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Model => serializer.serialize_unit_variant("BatchDeploymentConfigurationType", 0u32, "Model"), - Self::PipelineComponent => serializer.serialize_unit_variant("BatchDeploymentConfigurationType", 1u32, "PipelineComponent"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchDeploymentTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Batch inference settings per deployment."] - pub properties: BatchDeployment, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl BatchDeploymentTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: BatchDeployment) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of BatchDeployment entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchDeploymentTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of BatchDeployment objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type BatchDeployment."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for BatchDeploymentTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl BatchDeploymentTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Batch endpoint configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchEndpoint { - #[serde(flatten)] - pub endpoint_properties_base: EndpointPropertiesBase, - #[doc = "Batch endpoint default values"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub defaults: Option, - #[doc = "State of endpoint provisioning."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl BatchEndpoint { - pub fn new(endpoint_properties_base: EndpointPropertiesBase) -> Self { - Self { - endpoint_properties_base, - defaults: None, - provisioning_state: None, - } - } -} -#[doc = "Batch endpoint default values"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchEndpointDefaults { - #[doc = "Name of the deployment that will be default for the endpoint.\r\nThis deployment will end up getting 100% traffic when the endpoint scoring URL is invoked."] - #[serde(rename = "deploymentName", default, skip_serializing_if = "Option::is_none")] - pub deployment_name: Option, -} -impl BatchEndpointDefaults { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchEndpointTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Batch endpoint configuration."] - pub properties: BatchEndpoint, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl BatchEndpointTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: BatchEndpoint) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of BatchEndpoint entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchEndpointTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of BatchEndpoint objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type BatchEndpoint."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for BatchEndpointTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl BatchEndpointTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Log verbosity for batch inferencing.\r\nIncreasing verbosity order for logging is : Warning, Info and Debug.\r\nThe default value is Info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BatchLoggingLevel")] -pub enum BatchLoggingLevel { - Info, - Warning, - Debug, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BatchLoggingLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BatchLoggingLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BatchLoggingLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Info => serializer.serialize_unit_variant("BatchLoggingLevel", 0u32, "Info"), - Self::Warning => serializer.serialize_unit_variant("BatchLoggingLevel", 1u32, "Warning"), - Self::Debug => serializer.serialize_unit_variant("BatchLoggingLevel", 2u32, "Debug"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine how batch inferencing will handle output"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BatchOutputAction")] -pub enum BatchOutputAction { - SummaryOnly, - AppendRow, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BatchOutputAction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BatchOutputAction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BatchOutputAction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SummaryOnly => serializer.serialize_unit_variant("BatchOutputAction", 0u32, "SummaryOnly"), - Self::AppendRow => serializer.serialize_unit_variant("BatchOutputAction", 1u32, "AppendRow"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Properties for a Batch Pipeline Component Deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchPipelineComponentDeploymentConfiguration { - #[serde(flatten)] - pub batch_deployment_configuration: BatchDeploymentConfiguration, - #[doc = "Reference to an asset via its ARM resource ID."] - #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] - pub component_id: Option, - #[doc = "The description which will be applied to the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Run-time settings for the pipeline job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option, - #[doc = "The tags which will be applied to the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl BatchPipelineComponentDeploymentConfiguration { - pub fn new(batch_deployment_configuration: BatchDeploymentConfiguration) -> Self { - Self { - batch_deployment_configuration, - component_id: None, - description: None, - settings: None, - tags: None, - } - } -} -#[doc = "Retry settings for a batch inference operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchRetrySettings { - #[doc = "Maximum retry count for a mini-batch"] - #[serde(rename = "maxRetries", default, skip_serializing_if = "Option::is_none")] - pub max_retries: Option, - #[doc = "Invocation timeout for a mini-batch, in ISO 8601 format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl BatchRetrySettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines a Sampling Algorithm that generates values based on previous values"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BayesianSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, -} -impl BayesianSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { sampling_algorithm } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BindOptions { - #[doc = "Type of Bind Option"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub propagation: Option, - #[doc = "Indicate whether to create host path."] - #[serde(rename = "createHostPath", default, skip_serializing_if = "Option::is_none")] - pub create_host_path: Option, - #[doc = "Mention the selinux options."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selinux: Option, -} -impl BindOptions { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BlobReferenceForConsumptionDto { - #[doc = "Blob URI path for client to upload data.\r\nExample: https://blob.windows.core.net/Container/Path"] - #[serde(rename = "blobUri", default, skip_serializing_if = "Option::is_none")] - pub blob_uri: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credential: Option, - #[doc = "Arm ID of the storage account to use"] - #[serde(rename = "storageAccountArmId", default, skip_serializing_if = "Option::is_none")] - pub storage_account_arm_id: Option, -} -impl BlobReferenceForConsumptionDto { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum for all classification models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BlockedTransformers")] -pub enum BlockedTransformers { - TextTargetEncoder, - OneHotEncoder, - CatTargetEncoder, - TfIdf, - WoETargetEncoder, - LabelEncoder, - WordEmbedding, - NaiveBayes, - CountVectorizer, - HashOneHotEncoder, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BlockedTransformers { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BlockedTransformers { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BlockedTransformers { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::TextTargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 0u32, "TextTargetEncoder"), - Self::OneHotEncoder => serializer.serialize_unit_variant("BlockedTransformers", 1u32, "OneHotEncoder"), - Self::CatTargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 2u32, "CatTargetEncoder"), - Self::TfIdf => serializer.serialize_unit_variant("BlockedTransformers", 3u32, "TfIdf"), - Self::WoETargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 4u32, "WoETargetEncoder"), - Self::LabelEncoder => serializer.serialize_unit_variant("BlockedTransformers", 5u32, "LabelEncoder"), - Self::WordEmbedding => serializer.serialize_unit_variant("BlockedTransformers", 6u32, "WordEmbedding"), - Self::NaiveBayes => serializer.serialize_unit_variant("BlockedTransformers", 7u32, "NaiveBayes"), - Self::CountVectorizer => serializer.serialize_unit_variant("BlockedTransformers", 8u32, "CountVectorizer"), - Self::HashOneHotEncoder => serializer.serialize_unit_variant("BlockedTransformers", 9u32, "HashOneHotEncoder"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Configuration settings for Docker build context"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BuildContext { - #[doc = "[Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs.\r\n"] - #[serde(rename = "contextUri")] - pub context_uri: String, - #[doc = "Path to the Dockerfile in the build context.\r\n"] - #[serde(rename = "dockerfilePath", default, skip_serializing_if = "Option::is_none")] - pub dockerfile_path: Option, -} -impl BuildContext { - pub fn new(context_uri: String) -> Self { - Self { - context_uri, - dockerfile_path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CategoricalDataDriftMetric")] -pub enum CategoricalDataDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - PearsonsChiSquaredTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CategoricalDataDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CategoricalDataDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CategoricalDataDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => serializer.serialize_unit_variant("CategoricalDataDriftMetric", 0u32, "JensenShannonDistance"), - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("CategoricalDataDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::PearsonsChiSquaredTest => serializer.serialize_unit_variant("CategoricalDataDriftMetric", 2u32, "PearsonsChiSquaredTest"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CategoricalDataDriftMetricThreshold { - #[serde(flatten)] - pub data_drift_metric_threshold_base: DataDriftMetricThresholdBase, - pub metric: CategoricalDataDriftMetric, -} -impl CategoricalDataDriftMetricThreshold { - pub fn new(data_drift_metric_threshold_base: DataDriftMetricThresholdBase, metric: CategoricalDataDriftMetric) -> Self { - Self { - data_drift_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CategoricalDataQualityMetric")] -pub enum CategoricalDataQualityMetric { - NullValueRate, - DataTypeErrorRate, - OutOfBoundsRate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CategoricalDataQualityMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CategoricalDataQualityMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CategoricalDataQualityMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NullValueRate => serializer.serialize_unit_variant("CategoricalDataQualityMetric", 0u32, "NullValueRate"), - Self::DataTypeErrorRate => serializer.serialize_unit_variant("CategoricalDataQualityMetric", 1u32, "DataTypeErrorRate"), - Self::OutOfBoundsRate => serializer.serialize_unit_variant("CategoricalDataQualityMetric", 2u32, "OutOfBoundsRate"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CategoricalDataQualityMetricThreshold { - #[serde(flatten)] - pub data_quality_metric_threshold_base: DataQualityMetricThresholdBase, - pub metric: CategoricalDataQualityMetric, -} -impl CategoricalDataQualityMetricThreshold { - pub fn new(data_quality_metric_threshold_base: DataQualityMetricThresholdBase, metric: CategoricalDataQualityMetric) -> Self { - Self { - data_quality_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CategoricalPredictionDriftMetric")] -pub enum CategoricalPredictionDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - PearsonsChiSquaredTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CategoricalPredictionDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CategoricalPredictionDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CategoricalPredictionDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => { - serializer.serialize_unit_variant("CategoricalPredictionDriftMetric", 0u32, "JensenShannonDistance") - } - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("CategoricalPredictionDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::PearsonsChiSquaredTest => { - serializer.serialize_unit_variant("CategoricalPredictionDriftMetric", 2u32, "PearsonsChiSquaredTest") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CategoricalPredictionDriftMetricThreshold { - #[serde(flatten)] - pub prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, - pub metric: CategoricalPredictionDriftMetric, -} -impl CategoricalPredictionDriftMetricThreshold { - pub fn new( - prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, - metric: CategoricalPredictionDriftMetric, - ) -> Self { - Self { - prediction_drift_metric_threshold_base, - metric, - } - } -} -#[doc = "Certificate datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Authority URL used for authentication."] - #[serde(rename = "authorityUrl", default, skip_serializing_if = "Option::is_none")] - pub authority_url: Option, - #[doc = "[Required] Service principal client ID."] - #[serde(rename = "clientId")] - pub client_id: String, - #[doc = "Resource the service principal has access to."] - #[serde(rename = "resourceUrl", default, skip_serializing_if = "Option::is_none")] - pub resource_url: Option, - #[doc = "Datastore certificate secrets."] - pub secrets: CertificateDatastoreSecrets, - #[doc = "[Required] ID of the tenant to which the service principal belongs."] - #[serde(rename = "tenantId")] - pub tenant_id: String, - #[doc = "[Required] Thumbprint of the certificate used for authentication."] - pub thumbprint: String, -} -impl CertificateDatastoreCredentials { - pub fn new( - datastore_credentials: DatastoreCredentials, - client_id: String, - secrets: CertificateDatastoreSecrets, - tenant_id: String, - thumbprint: String, - ) -> Self { - Self { - datastore_credentials, - authority_url: None, - client_id, - resource_url: None, - secrets, - tenant_id, - thumbprint, - } - } -} -#[doc = "Datastore certificate secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Service principal certificate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub certificate: Option, -} -impl CertificateDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - certificate: None, - } - } -} -#[doc = "Classification task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Classification { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Positive label for binary metrics calculation."] - #[serde(rename = "positiveLabel", default, skip_serializing_if = "Option::is_none")] - pub positive_label: Option, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Classification Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Classification { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - positive_label: None, - primary_metric: None, - training_settings: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationModelPerformanceMetric")] -pub enum ClassificationModelPerformanceMetric { - Accuracy, - Precision, - Recall, - F1Score, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationModelPerformanceMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationModelPerformanceMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationModelPerformanceMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Accuracy => serializer.serialize_unit_variant("ClassificationModelPerformanceMetric", 0u32, "Accuracy"), - Self::Precision => serializer.serialize_unit_variant("ClassificationModelPerformanceMetric", 1u32, "Precision"), - Self::Recall => serializer.serialize_unit_variant("ClassificationModelPerformanceMetric", 2u32, "Recall"), - Self::F1Score => serializer.serialize_unit_variant("ClassificationModelPerformanceMetric", 3u32, "F1Score"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ClassificationModelPerformanceMetricThreshold { - #[serde(flatten)] - pub model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - pub metric: ClassificationModelPerformanceMetric, -} -impl ClassificationModelPerformanceMetricThreshold { - pub fn new( - model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - metric: ClassificationModelPerformanceMetric, - ) -> Self { - Self { - model_performance_metric_threshold_base, - metric, - } - } -} -#[doc = "Enum for all classification models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationModels")] -pub enum ClassificationModels { - LogisticRegression, - #[serde(rename = "SGD")] - Sgd, - MultinomialNaiveBayes, - BernoulliNaiveBayes, - #[serde(rename = "SVM")] - Svm, - #[serde(rename = "LinearSVM")] - LinearSvm, - #[serde(rename = "KNN")] - Knn, - DecisionTree, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - GradientBoosting, - #[serde(rename = "XGBoostClassifier")] - XgBoostClassifier, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationModels { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationModels { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationModels { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::LogisticRegression => serializer.serialize_unit_variant("ClassificationModels", 0u32, "LogisticRegression"), - Self::Sgd => serializer.serialize_unit_variant("ClassificationModels", 1u32, "SGD"), - Self::MultinomialNaiveBayes => serializer.serialize_unit_variant("ClassificationModels", 2u32, "MultinomialNaiveBayes"), - Self::BernoulliNaiveBayes => serializer.serialize_unit_variant("ClassificationModels", 3u32, "BernoulliNaiveBayes"), - Self::Svm => serializer.serialize_unit_variant("ClassificationModels", 4u32, "SVM"), - Self::LinearSvm => serializer.serialize_unit_variant("ClassificationModels", 5u32, "LinearSVM"), - Self::Knn => serializer.serialize_unit_variant("ClassificationModels", 6u32, "KNN"), - Self::DecisionTree => serializer.serialize_unit_variant("ClassificationModels", 7u32, "DecisionTree"), - Self::RandomForest => serializer.serialize_unit_variant("ClassificationModels", 8u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("ClassificationModels", 9u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("ClassificationModels", 10u32, "LightGBM"), - Self::GradientBoosting => serializer.serialize_unit_variant("ClassificationModels", 11u32, "GradientBoosting"), - Self::XgBoostClassifier => serializer.serialize_unit_variant("ClassificationModels", 12u32, "XGBoostClassifier"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for classification multilabel tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationMultilabelPrimaryMetrics")] -pub enum ClassificationMultilabelPrimaryMetrics { - #[serde(rename = "AUCWeighted")] - AucWeighted, - Accuracy, - NormMacroRecall, - AveragePrecisionScoreWeighted, - PrecisionScoreWeighted, - #[serde(rename = "IOU")] - Iou, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationMultilabelPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationMultilabelPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationMultilabelPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AucWeighted => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 0u32, "AUCWeighted"), - Self::Accuracy => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 1u32, "Accuracy"), - Self::NormMacroRecall => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 2u32, "NormMacroRecall"), - Self::AveragePrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 3u32, "AveragePrecisionScoreWeighted") - } - Self::PrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 4u32, "PrecisionScoreWeighted") - } - Self::Iou => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 5u32, "IOU"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for classification tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationPrimaryMetrics")] -pub enum ClassificationPrimaryMetrics { - #[serde(rename = "AUCWeighted")] - AucWeighted, - Accuracy, - NormMacroRecall, - AveragePrecisionScoreWeighted, - PrecisionScoreWeighted, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AucWeighted => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 0u32, "AUCWeighted"), - Self::Accuracy => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 1u32, "Accuracy"), - Self::NormMacroRecall => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 2u32, "NormMacroRecall"), - Self::AveragePrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 3u32, "AveragePrecisionScoreWeighted") - } - Self::PrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 4u32, "PrecisionScoreWeighted") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Classification Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClassificationTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for classification task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for classification task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl ClassificationTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AmlCompute update parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClusterUpdateParameters { - #[doc = "The properties of a amlCompute that need to be updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ClusterUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a amlCompute that need to be updated."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClusterUpdateProperties { - #[doc = "Desired scale settings for the amlCompute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ClusterUpdateProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CocoExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CocoExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} -#[doc = "Configuration for a scoring code asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CodeConfiguration { - #[doc = "ARM resource ID of the code asset."] - #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] - pub code_id: Option, - #[doc = "[Required] The script to execute on startup. eg. \"score.py\""] - #[serde(rename = "scoringScript")] - pub scoring_script: String, -} -impl CodeConfiguration { - pub fn new(scoring_script: String) -> Self { - Self { - code_id: None, - scoring_script, - } - } -} -#[doc = "Container for code asset versions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl CodeContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CodeContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Container for code asset versions."] - pub properties: CodeContainer, -} -impl CodeContainerResource { - pub fn new(properties: CodeContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of CodeContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of CodeContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type CodeContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for CodeContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl CodeContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Code asset version details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Uri where code is located"] - #[serde(rename = "codeUri", default, skip_serializing_if = "Option::is_none")] - pub code_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl CodeVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CodeVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Code asset version details."] - pub properties: CodeVersion, -} -impl CodeVersionResource { - pub fn new(properties: CodeVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of CodeVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of CodeVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type CodeVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for CodeVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl CodeVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Collection { - #[doc = "The msi client id used to collect logging to blob storage. If it's null,backend will pick a registered endpoint identity to auth."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "dataCollectionMode", default, skip_serializing_if = "Option::is_none")] - pub data_collection_mode: Option, - #[doc = "The data asset arm resource id. Client side will ensure data asset is pointing to the blob storage, and backend will collect data to the blob storage."] - #[serde(rename = "dataId", default, skip_serializing_if = "Option::is_none")] - pub data_id: Option, - #[doc = "The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data by default."] - #[serde(rename = "samplingRate", default, skip_serializing_if = "Option::is_none")] - pub sampling_rate: Option, -} -impl Collection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Column transformer parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ColumnTransformer { - #[doc = "Fields to apply transformer logic on."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub fields: Vec, - #[doc = "Different properties to be passed to transformer.\r\nInput expected is dictionary of key,value pairs in JSON format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, -} -impl ColumnTransformer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Command job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Settings for Autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, - #[doc = "ARM resource ID of the code asset."] - #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] - pub code_id: Option, - #[doc = "[Required] The command to execute on startup of the job. eg. \"python train.py\""] - pub command: String, - #[doc = "Base definition for job distribution configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, - #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId")] - pub environment_id: String, - #[doc = "Environment variables included in the job."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Command Job limit class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Input parameters."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl CommandJob { - pub fn new(job_base: JobBase, command: String, environment_id: String) -> Self { - Self { - job_base, - autologger_settings: None, - code_id: None, - command, - distribution: None, - environment_id, - environment_variables: None, - inputs: None, - limits: None, - outputs: None, - parameters: None, - queue_settings: None, - resources: None, - } - } -} -#[doc = "Command Job limit class."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandJobLimits { - #[serde(flatten)] - pub job_limits: JobLimits, -} -impl CommandJobLimits { - pub fn new(job_limits: JobLimits) -> Self { - Self { job_limits } - } -} -#[doc = "Component container definition.\r\n"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl ComponentContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComponentContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Component container definition.\r\n"] - pub properties: ComponentContainer, -} -impl ComponentContainerResource { - pub fn new(properties: ComponentContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ComponentContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of ComponentContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ComponentContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ComponentContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ComponentContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Definition of a component version: defines resources that span component types."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Defines Component definition details.\r\n"] - #[serde(rename = "componentSpec", default, skip_serializing_if = "Option::is_none")] - pub component_spec: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Stage in the component lifecycle"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl ComponentVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComponentVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Definition of a component version: defines resources that span component types."] - pub properties: ComponentVersion, -} -impl ComponentVersionResource { - pub fn new(properties: ComponentVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ComponentVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of ComponentVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ComponentVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ComponentVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ComponentVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Machine Learning compute object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Compute { - #[doc = "The type of compute"] - #[serde(rename = "computeType")] - pub compute_type: ComputeType, - #[doc = "Location for the underlying compute"] - #[serde(rename = "computeLocation", default, skip_serializing_if = "Option::is_none")] - pub compute_location: Option, - #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "The description of the Machine Learning compute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The time at which the compute was created."] - #[serde(rename = "createdOn", default, with = "azure_core::date::rfc3339::option")] - pub created_on: Option, - #[doc = "The time at which the compute was last modified."] - #[serde(rename = "modifiedOn", default, with = "azure_core::date::rfc3339::option")] - pub modified_on: Option, - #[doc = "ARM resource id of the underlying compute"] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, - #[doc = "Errors during provisioning"] - #[serde( - rename = "provisioningErrors", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub provisioning_errors: Vec, - #[doc = "Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false."] - #[serde(rename = "isAttachedCompute", default, skip_serializing_if = "Option::is_none")] - pub is_attached_compute: Option, - #[doc = "Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication."] - #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] - pub disable_local_auth: Option, -} -impl Compute { - pub fn new(compute_type: ComputeType) -> Self { - Self { - compute_type, - compute_location: None, - provisioning_state: None, - description: None, - created_on: None, - modified_on: None, - resource_id: None, - provisioning_errors: Vec::new(), - is_attached_compute: None, - disable_local_auth: None, - } - } -} -pub mod compute { - use super::*; - #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ProvisioningState")] - pub enum ProvisioningState { - Unknown, - Updating, - Creating, - Deleting, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), - Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), - Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "computeType")] -pub enum ComputeUnion { - #[serde(rename = "AKS")] - Aks(Aks), - AmlCompute(AmlCompute), - ComputeInstance(ComputeInstance), - DataFactory(DataFactory), - DataLakeAnalytics(DataLakeAnalytics), - Databricks(Databricks), - #[serde(rename = "HDInsight")] - HdInsight(HdInsight), - Kubernetes(Kubernetes), - SynapseSpark(SynapseSpark), - VirtualMachine(VirtualMachine), -} -#[doc = "An Azure Machine Learning compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComputeInstance { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub compute_instance_schema: ComputeInstanceSchema, -} -impl ComputeInstance { - pub fn new(compute: Compute) -> Self { - Self { - compute, - compute_instance_schema: ComputeInstanceSchema::default(), - } - } -} -#[doc = "Defines an Aml Instance application and its connectivity endpoint URI."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceApplication { - #[doc = "Name of the ComputeInstance application."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Application' endpoint URI."] - #[serde(rename = "endpointUri", default, skip_serializing_if = "Option::is_none")] - pub endpoint_uri: Option, -} -impl ComputeInstanceApplication { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Specifies settings for autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceAutologgerSettings { - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[serde(rename = "mlflowAutologger", default, skip_serializing_if = "Option::is_none")] - pub mlflow_autologger: Option, -} -impl ComputeInstanceAutologgerSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_autologger_settings { - use super::*; - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MlflowAutologger")] - pub enum MlflowAutologger { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MlflowAutologger { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MlflowAutologger { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MlflowAutologger { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlflowAutologger", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlflowAutologger", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceConnectivityEndpoints { - #[doc = "Public IP Address of this ComputeInstance."] - #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] - pub public_ip_address: Option, - #[doc = "Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed)."] - #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] - pub private_ip_address: Option, -} -impl ComputeInstanceConnectivityEndpoints { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines an Aml Instance container."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceContainer { - #[doc = "Name of the ComputeInstance container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Auto save settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub autosave: Option, - #[doc = "Information of GPU."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gpu: Option, - #[doc = "network of this container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub network: Option, - #[doc = "Environment information"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option, - #[doc = "services of this containers."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub services: Vec, -} -impl ComputeInstanceContainer { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_container { - use super::*; - #[doc = "Auto save settings."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Autosave")] - pub enum Autosave { - None, - Local, - Remote, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Autosave { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Autosave { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Autosave { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("Autosave", 0u32, "None"), - Self::Local => serializer.serialize_unit_variant("Autosave", 1u32, "Local"), - Self::Remote => serializer.serialize_unit_variant("Autosave", 2u32, "Remote"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "network of this container."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Network")] - pub enum Network { - Bridge, - Host, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Network { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Network { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Network { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bridge => serializer.serialize_unit_variant("Network", 0u32, "Bridge"), - Self::Host => serializer.serialize_unit_variant("Network", 1u32, "Host"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Describes information on user who created this ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceCreatedBy { - #[doc = "Name of the user."] - #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] - pub user_name: Option, - #[doc = "Uniquely identifies user' Azure Active Directory organization."] - #[serde(rename = "userOrgId", default, skip_serializing_if = "Option::is_none")] - pub user_org_id: Option, - #[doc = "Uniquely identifies the user within his/her organization."] - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, -} -impl ComputeInstanceCreatedBy { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines an Aml Instance DataDisk."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceDataDisk { - #[doc = "Caching type of Data Disk."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub caching: Option, - #[doc = "The initial disk size in gigabytes."] - #[serde(rename = "diskSizeGB", default, skip_serializing_if = "Option::is_none")] - pub disk_size_gb: Option, - #[doc = "The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub lun: Option, - #[doc = "type of this storage account."] - #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] - pub storage_account_type: Option, -} -impl ComputeInstanceDataDisk { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_data_disk { - use super::*; - #[doc = "Caching type of Data Disk."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Caching")] - pub enum Caching { - None, - ReadOnly, - ReadWrite, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Caching { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Caching { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Caching { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("Caching", 0u32, "None"), - Self::ReadOnly => serializer.serialize_unit_variant("Caching", 1u32, "ReadOnly"), - Self::ReadWrite => serializer.serialize_unit_variant("Caching", 2u32, "ReadWrite"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "type of this storage account."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "StorageAccountType")] - pub enum StorageAccountType { - #[serde(rename = "Standard_LRS")] - StandardLrs, - #[serde(rename = "Premium_LRS")] - PremiumLrs, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for StorageAccountType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for StorageAccountType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for StorageAccountType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::StandardLrs => serializer.serialize_unit_variant("StorageAccountType", 0u32, "Standard_LRS"), - Self::PremiumLrs => serializer.serialize_unit_variant("StorageAccountType", 1u32, "Premium_LRS"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for StorageAccountType { - fn default() -> Self { - Self::StandardLrs - } - } -} -#[doc = "Defines an Aml Instance DataMount."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceDataMount { - #[doc = "Source of the ComputeInstance data mount."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Data source type."] - #[serde(rename = "sourceType", default, skip_serializing_if = "Option::is_none")] - pub source_type: Option, - #[doc = "name of the ComputeInstance data mount."] - #[serde(rename = "mountName", default, skip_serializing_if = "Option::is_none")] - pub mount_name: Option, - #[doc = "Mount Action."] - #[serde(rename = "mountAction", default, skip_serializing_if = "Option::is_none")] - pub mount_action: Option, - #[doc = "who this data mount created by."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "Path of this data mount."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, - #[doc = "Mount state."] - #[serde(rename = "mountState", default, skip_serializing_if = "Option::is_none")] - pub mount_state: Option, - #[doc = "The time when the disk mounted."] - #[serde(rename = "mountedOn", default, with = "azure_core::date::rfc3339::option")] - pub mounted_on: Option, - #[doc = "Error of this data mount."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl ComputeInstanceDataMount { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_data_mount { - use super::*; - #[doc = "Data source type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "SourceType")] - pub enum SourceType { - Dataset, - Datastore, - #[serde(rename = "URI")] - Uri, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for SourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for SourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for SourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dataset => serializer.serialize_unit_variant("SourceType", 0u32, "Dataset"), - Self::Datastore => serializer.serialize_unit_variant("SourceType", 1u32, "Datastore"), - Self::Uri => serializer.serialize_unit_variant("SourceType", 2u32, "URI"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Mount Action."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MountAction")] - pub enum MountAction { - Mount, - Unmount, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MountAction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MountAction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MountAction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Mount => serializer.serialize_unit_variant("MountAction", 0u32, "Mount"), - Self::Unmount => serializer.serialize_unit_variant("MountAction", 1u32, "Unmount"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Mount state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MountState")] - pub enum MountState { - MountRequested, - Mounted, - MountFailed, - UnmountRequested, - UnmountFailed, - Unmounted, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MountState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MountState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MountState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MountRequested => serializer.serialize_unit_variant("MountState", 0u32, "MountRequested"), - Self::Mounted => serializer.serialize_unit_variant("MountState", 1u32, "Mounted"), - Self::MountFailed => serializer.serialize_unit_variant("MountState", 2u32, "MountFailed"), - Self::UnmountRequested => serializer.serialize_unit_variant("MountState", 3u32, "UnmountRequested"), - Self::UnmountFailed => serializer.serialize_unit_variant("MountState", 4u32, "UnmountFailed"), - Self::Unmounted => serializer.serialize_unit_variant("MountState", 5u32, "Unmounted"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Environment information"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceEnvironmentInfo { - #[doc = "name of environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "version of environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, -} -impl ComputeInstanceEnvironmentInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The last operation on ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceLastOperation { - #[doc = "Name of the last operation."] - #[serde(rename = "operationName", default, skip_serializing_if = "Option::is_none")] - pub operation_name: Option, - #[doc = "Time of the last operation."] - #[serde(rename = "operationTime", default, with = "azure_core::date::rfc3339::option")] - pub operation_time: Option, - #[doc = "Operation status."] - #[serde(rename = "operationStatus", default, skip_serializing_if = "Option::is_none")] - pub operation_status: Option, - #[doc = "Trigger of operation."] - #[serde(rename = "operationTrigger", default, skip_serializing_if = "Option::is_none")] - pub operation_trigger: Option, -} -impl ComputeInstanceLastOperation { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_last_operation { - use super::*; - #[doc = "Name of the last operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OperationName")] - pub enum OperationName { - Create, - Start, - Stop, - Restart, - Reimage, - Delete, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OperationName { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OperationName { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OperationName { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Create => serializer.serialize_unit_variant("OperationName", 0u32, "Create"), - Self::Start => serializer.serialize_unit_variant("OperationName", 1u32, "Start"), - Self::Stop => serializer.serialize_unit_variant("OperationName", 2u32, "Stop"), - Self::Restart => serializer.serialize_unit_variant("OperationName", 3u32, "Restart"), - Self::Reimage => serializer.serialize_unit_variant("OperationName", 4u32, "Reimage"), - Self::Delete => serializer.serialize_unit_variant("OperationName", 5u32, "Delete"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Operation status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OperationStatus")] - pub enum OperationStatus { - InProgress, - Succeeded, - CreateFailed, - StartFailed, - StopFailed, - RestartFailed, - ReimageFailed, - DeleteFailed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OperationStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OperationStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OperationStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::InProgress => serializer.serialize_unit_variant("OperationStatus", 0u32, "InProgress"), - Self::Succeeded => serializer.serialize_unit_variant("OperationStatus", 1u32, "Succeeded"), - Self::CreateFailed => serializer.serialize_unit_variant("OperationStatus", 2u32, "CreateFailed"), - Self::StartFailed => serializer.serialize_unit_variant("OperationStatus", 3u32, "StartFailed"), - Self::StopFailed => serializer.serialize_unit_variant("OperationStatus", 4u32, "StopFailed"), - Self::RestartFailed => serializer.serialize_unit_variant("OperationStatus", 5u32, "RestartFailed"), - Self::ReimageFailed => serializer.serialize_unit_variant("OperationStatus", 6u32, "ReimageFailed"), - Self::DeleteFailed => serializer.serialize_unit_variant("OperationStatus", 7u32, "DeleteFailed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Trigger of operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OperationTrigger")] - pub enum OperationTrigger { - User, - Schedule, - IdleShutdown, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OperationTrigger { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OperationTrigger { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OperationTrigger { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("OperationTrigger", 0u32, "User"), - Self::Schedule => serializer.serialize_unit_variant("OperationTrigger", 1u32, "Schedule"), - Self::IdleShutdown => serializer.serialize_unit_variant("OperationTrigger", 2u32, "IdleShutdown"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Compute Instance properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceProperties { - #[doc = "Virtual Machine Size"] - #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] - pub vm_size: Option, - #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subnet: Option, - #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] - #[serde(rename = "applicationSharingPolicy", default, skip_serializing_if = "Option::is_none")] - pub application_sharing_policy: Option, - #[doc = "Specifies settings for autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, - #[doc = "Specifies policy and settings for SSH access."] - #[serde(rename = "sshSettings", default, skip_serializing_if = "Option::is_none")] - pub ssh_settings: Option, - #[doc = "List of Custom Services added to the compute."] - #[serde( - rename = "customServices", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub custom_services: Vec, - #[doc = "Returns metadata about the operating system image for this compute instance."] - #[serde(rename = "osImageMetadata", default, skip_serializing_if = "Option::is_none")] - pub os_image_metadata: Option, - #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] - #[serde(rename = "connectivityEndpoints", default, skip_serializing_if = "Option::is_none")] - pub connectivity_endpoints: Option, - #[doc = "Describes available applications and their endpoints on this ComputeInstance."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub applications: Vec, - #[doc = "Describes information on user who created this ComputeInstance."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "Collection of errors encountered on this ComputeInstance."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub errors: Vec, - #[doc = "Current state of an ComputeInstance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] - #[serde(rename = "computeInstanceAuthorizationType", default, skip_serializing_if = "Option::is_none")] - pub compute_instance_authorization_type: Option, - #[doc = "Settings for a personal compute instance."] - #[serde(rename = "personalComputeInstanceSettings", default, skip_serializing_if = "Option::is_none")] - pub personal_compute_instance_settings: Option, - #[doc = "Details of customized scripts to execute for setting up the cluster."] - #[serde(rename = "setupScripts", default, skip_serializing_if = "Option::is_none")] - pub setup_scripts: Option, - #[doc = "The last operation on ComputeInstance."] - #[serde(rename = "lastOperation", default, skip_serializing_if = "Option::is_none")] - pub last_operation: Option, - #[doc = "The list of schedules to be applied on the computes"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedules: Option, - #[doc = "Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, - #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] - #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] - pub enable_node_public_ip: Option, - #[doc = "Describes informations of containers on this ComputeInstance."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub containers: Vec, - #[doc = "Describes informations of dataDisks on this ComputeInstance."] - #[serde( - rename = "dataDisks", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub data_disks: Vec, - #[doc = "Describes informations of dataMounts on this ComputeInstance."] - #[serde( - rename = "dataMounts", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub data_mounts: Vec, - #[doc = "Version of computeInstance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub versions: Option, -} -impl ComputeInstanceProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_properties { - use super::*; - #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ApplicationSharingPolicy")] - pub enum ApplicationSharingPolicy { - Personal, - Shared, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ApplicationSharingPolicy { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ApplicationSharingPolicy { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ApplicationSharingPolicy { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Personal => serializer.serialize_unit_variant("ApplicationSharingPolicy", 0u32, "Personal"), - Self::Shared => serializer.serialize_unit_variant("ApplicationSharingPolicy", 1u32, "Shared"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for ApplicationSharingPolicy { - fn default() -> Self { - Self::Shared - } - } - #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ComputeInstanceAuthorizationType")] - pub enum ComputeInstanceAuthorizationType { - #[serde(rename = "personal")] - Personal, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ComputeInstanceAuthorizationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ComputeInstanceAuthorizationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ComputeInstanceAuthorizationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Personal => serializer.serialize_unit_variant("ComputeInstanceAuthorizationType", 0u32, "personal"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for ComputeInstanceAuthorizationType { - fn default() -> Self { - Self::Personal - } - } -} -#[doc = "Properties(top level) of ComputeInstance"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceSchema { - #[doc = "Compute Instance properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ComputeInstanceSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Specifies policy and settings for SSH access."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceSshSettings { - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] - #[serde(rename = "sshPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub ssh_public_access: Option, - #[doc = "Describes the admin user name."] - #[serde(rename = "adminUserName", default, skip_serializing_if = "Option::is_none")] - pub admin_user_name: Option, - #[doc = "Describes the port for connecting through SSH."] - #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] - pub ssh_port: Option, - #[doc = "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs."] - #[serde(rename = "adminPublicKey", default, skip_serializing_if = "Option::is_none")] - pub admin_public_key: Option, -} -impl ComputeInstanceSshSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_ssh_settings { - use super::*; - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "SshPublicAccess")] - pub enum SshPublicAccess { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for SshPublicAccess { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for SshPublicAccess { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for SshPublicAccess { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("SshPublicAccess", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("SshPublicAccess", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for SshPublicAccess { - fn default() -> Self { - Self::Disabled - } - } -} -#[doc = "Current state of an ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ComputeInstanceState")] -pub enum ComputeInstanceState { - Creating, - CreateFailed, - Deleting, - Running, - Restarting, - JobRunning, - SettingUp, - SetupFailed, - Starting, - Stopped, - Stopping, - UserSettingUp, - UserSetupFailed, - Unknown, - Unusable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ComputeInstanceState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ComputeInstanceState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ComputeInstanceState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("ComputeInstanceState", 0u32, "Creating"), - Self::CreateFailed => serializer.serialize_unit_variant("ComputeInstanceState", 1u32, "CreateFailed"), - Self::Deleting => serializer.serialize_unit_variant("ComputeInstanceState", 2u32, "Deleting"), - Self::Running => serializer.serialize_unit_variant("ComputeInstanceState", 3u32, "Running"), - Self::Restarting => serializer.serialize_unit_variant("ComputeInstanceState", 4u32, "Restarting"), - Self::JobRunning => serializer.serialize_unit_variant("ComputeInstanceState", 5u32, "JobRunning"), - Self::SettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 6u32, "SettingUp"), - Self::SetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 7u32, "SetupFailed"), - Self::Starting => serializer.serialize_unit_variant("ComputeInstanceState", 8u32, "Starting"), - Self::Stopped => serializer.serialize_unit_variant("ComputeInstanceState", 9u32, "Stopped"), - Self::Stopping => serializer.serialize_unit_variant("ComputeInstanceState", 10u32, "Stopping"), - Self::UserSettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 11u32, "UserSettingUp"), - Self::UserSetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 12u32, "UserSetupFailed"), - Self::Unknown => serializer.serialize_unit_variant("ComputeInstanceState", 13u32, "Unknown"), - Self::Unusable => serializer.serialize_unit_variant("ComputeInstanceState", 14u32, "Unusable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Version of computeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceVersion { - #[doc = "Runtime of compute instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub runtime: Option, -} -impl ComputeInstanceVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "[Required] The compute power action."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ComputePowerAction")] -pub enum ComputePowerAction { - Start, - Stop, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ComputePowerAction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ComputePowerAction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ComputePowerAction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Start => serializer.serialize_unit_variant("ComputePowerAction", 0u32, "Start"), - Self::Stop => serializer.serialize_unit_variant("ComputePowerAction", 1u32, "Stop"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Machine Learning compute object wrapped into ARM resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeResource { - #[serde(flatten)] - pub resource: Resource, - #[serde(flatten)] - pub compute_resource_schema: ComputeResourceSchema, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Specifies the location of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Contains resource tags defined as key/value pairs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl ComputeResource { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeResourceSchema { - #[doc = "Machine Learning compute object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ComputeResourceSchema { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeRuntimeDto { - #[serde(rename = "sparkRuntimeVersion", default, skip_serializing_if = "Option::is_none")] - pub spark_runtime_version: Option, -} -impl ComputeRuntimeDto { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The list of schedules to be applied on the computes"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeSchedules { - #[doc = "The list of compute start stop schedules to be applied."] - #[serde( - rename = "computeStartStop", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub compute_start_stop: Vec, -} -impl ComputeSchedules { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Secrets related to a Machine Learning compute. Might differ for every type of compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComputeSecrets { - #[doc = "The type of compute"] - #[serde(rename = "computeType")] - pub compute_type: ComputeType, -} -impl ComputeSecrets { - pub fn new(compute_type: ComputeType) -> Self { - Self { compute_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "computeType")] -pub enum ComputeSecretsUnion { - #[serde(rename = "AKS")] - Aks(AksComputeSecrets), - Databricks(DatabricksComputeSecrets), - VirtualMachine(VirtualMachineSecrets), -} -#[doc = "Compute start stop schedule properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeStartStopSchedule { - #[doc = "A system assigned id for the schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The current deployment state of schedule."] - #[serde(rename = "provisioningStatus", default, skip_serializing_if = "Option::is_none")] - pub provisioning_status: Option, - #[doc = "Is the schedule enabled or disabled?"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "[Required] The compute power action."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option, - #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] - pub trigger_type: Option, - #[doc = "The workflow trigger recurrence for ComputeStartStop schedule type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub recurrence: Option, - #[doc = "The workflow trigger cron for ComputeStartStop schedule type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cron: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl ComputeStartStopSchedule { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_start_stop_schedule { - use super::*; - #[doc = "The current deployment state of schedule."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ProvisioningStatus")] - pub enum ProvisioningStatus { - Completed, - Provisioning, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ProvisioningStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ProvisioningStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ProvisioningStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Completed => serializer.serialize_unit_variant("ProvisioningStatus", 0u32, "Completed"), - Self::Provisioning => serializer.serialize_unit_variant("ProvisioningStatus", 1u32, "Provisioning"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningStatus", 2u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The type of compute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ComputeType")] -pub enum ComputeType { - #[serde(rename = "AKS")] - Aks, - Kubernetes, - AmlCompute, - ComputeInstance, - DataFactory, - VirtualMachine, - #[serde(rename = "HDInsight")] - HdInsight, - Databricks, - DataLakeAnalytics, - SynapseSpark, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ComputeType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ComputeType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ComputeType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Aks => serializer.serialize_unit_variant("ComputeType", 0u32, "AKS"), - Self::Kubernetes => serializer.serialize_unit_variant("ComputeType", 1u32, "Kubernetes"), - Self::AmlCompute => serializer.serialize_unit_variant("ComputeType", 2u32, "AmlCompute"), - Self::ComputeInstance => serializer.serialize_unit_variant("ComputeType", 3u32, "ComputeInstance"), - Self::DataFactory => serializer.serialize_unit_variant("ComputeType", 4u32, "DataFactory"), - Self::VirtualMachine => serializer.serialize_unit_variant("ComputeType", 5u32, "VirtualMachine"), - Self::HdInsight => serializer.serialize_unit_variant("ComputeType", 6u32, "HDInsight"), - Self::Databricks => serializer.serialize_unit_variant("ComputeType", 7u32, "Databricks"), - Self::DataLakeAnalytics => serializer.serialize_unit_variant("ComputeType", 8u32, "DataLakeAnalytics"), - Self::SynapseSpark => serializer.serialize_unit_variant("ComputeType", 9u32, "SynapseSpark"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Authentication type of the connection target"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ConnectionAuthType")] -pub enum ConnectionAuthType { - #[serde(rename = "PAT")] - Pat, - ManagedIdentity, - UsernamePassword, - None, - #[serde(rename = "SAS")] - Sas, - ServicePrincipal, - AccessKey, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ConnectionAuthType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ConnectionAuthType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ConnectionAuthType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Pat => serializer.serialize_unit_variant("ConnectionAuthType", 0u32, "PAT"), - Self::ManagedIdentity => serializer.serialize_unit_variant("ConnectionAuthType", 1u32, "ManagedIdentity"), - Self::UsernamePassword => serializer.serialize_unit_variant("ConnectionAuthType", 2u32, "UsernamePassword"), - Self::None => serializer.serialize_unit_variant("ConnectionAuthType", 3u32, "None"), - Self::Sas => serializer.serialize_unit_variant("ConnectionAuthType", 4u32, "SAS"), - Self::ServicePrincipal => serializer.serialize_unit_variant("ConnectionAuthType", 5u32, "ServicePrincipal"), - Self::AccessKey => serializer.serialize_unit_variant("ConnectionAuthType", 6u32, "AccessKey"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Category of the connection"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ConnectionCategory")] -pub enum ConnectionCategory { - PythonFeed, - ContainerRegistry, - Git, - FeatureStore, - S3, - Snowflake, - AzureSqlDb, - AzureSynapseAnalytics, - AzureMySqlDb, - AzurePostgresDb, - AzureDataLakeGen2, - Redis, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ConnectionCategory { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ConnectionCategory { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ConnectionCategory { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::PythonFeed => serializer.serialize_unit_variant("ConnectionCategory", 0u32, "PythonFeed"), - Self::ContainerRegistry => serializer.serialize_unit_variant("ConnectionCategory", 1u32, "ContainerRegistry"), - Self::Git => serializer.serialize_unit_variant("ConnectionCategory", 2u32, "Git"), - Self::FeatureStore => serializer.serialize_unit_variant("ConnectionCategory", 3u32, "FeatureStore"), - Self::S3 => serializer.serialize_unit_variant("ConnectionCategory", 4u32, "S3"), - Self::Snowflake => serializer.serialize_unit_variant("ConnectionCategory", 5u32, "Snowflake"), - Self::AzureSqlDb => serializer.serialize_unit_variant("ConnectionCategory", 6u32, "AzureSqlDb"), - Self::AzureSynapseAnalytics => serializer.serialize_unit_variant("ConnectionCategory", 7u32, "AzureSynapseAnalytics"), - Self::AzureMySqlDb => serializer.serialize_unit_variant("ConnectionCategory", 8u32, "AzureMySqlDb"), - Self::AzurePostgresDb => serializer.serialize_unit_variant("ConnectionCategory", 9u32, "AzurePostgresDb"), - Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("ConnectionCategory", 10u32, "AzureDataLakeGen2"), - Self::Redis => serializer.serialize_unit_variant("ConnectionCategory", 11u32, "Redis"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Resource requirements for each container instance within an online deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ContainerResourceRequirements { - #[serde(rename = "containerResourceLimits", default, skip_serializing_if = "Option::is_none")] - pub container_resource_limits: Option, - #[serde(rename = "containerResourceRequests", default, skip_serializing_if = "Option::is_none")] - pub container_resource_requests: Option, -} -impl ContainerResourceRequirements { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ContainerResourceSettings { - #[doc = "Number of vCPUs request/limit for container. More info:\r\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cpu: Option, - #[doc = "Number of Nvidia GPU cards request/limit for container. More info:\r\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gpu: Option, - #[doc = "Memory size request/limit for container. More info:\r\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub memory: Option, -} -impl ContainerResourceSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The type of container to retrieve logs from."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ContainerType")] -pub enum ContainerType { - StorageInitializer, - InferenceServer, - ModelDataCollector, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ContainerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ContainerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ContainerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::StorageInitializer => serializer.serialize_unit_variant("ContainerType", 0u32, "StorageInitializer"), - Self::InferenceServer => serializer.serialize_unit_variant("ContainerType", 1u32, "InferenceServer"), - Self::ModelDataCollector => serializer.serialize_unit_variant("ContainerType", 2u32, "ModelDataCollector"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CosmosDbSettings { - #[doc = "The throughput of the collections in cosmosdb database"] - #[serde(rename = "collectionsThroughput", default, skip_serializing_if = "Option::is_none")] - pub collections_throughput: Option, -} -impl CosmosDbSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateMonitorAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[serde(rename = "monitorDefinition")] - pub monitor_definition: MonitorDefinition, -} -impl CreateMonitorAction { - pub fn new(schedule_action_base: ScheduleActionBase, monitor_definition: MonitorDefinition) -> Self { - Self { - schedule_action_base, - monitor_definition, - } - } -} -#[doc = "Enum to determine the datastore credentials type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CredentialsType")] -pub enum CredentialsType { - AccountKey, - Certificate, - None, - Sas, - ServicePrincipal, - KerberosKeytab, - KerberosPassword, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CredentialsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CredentialsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CredentialsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AccountKey => serializer.serialize_unit_variant("CredentialsType", 0u32, "AccountKey"), - Self::Certificate => serializer.serialize_unit_variant("CredentialsType", 1u32, "Certificate"), - Self::None => serializer.serialize_unit_variant("CredentialsType", 2u32, "None"), - Self::Sas => serializer.serialize_unit_variant("CredentialsType", 3u32, "Sas"), - Self::ServicePrincipal => serializer.serialize_unit_variant("CredentialsType", 4u32, "ServicePrincipal"), - Self::KerberosKeytab => serializer.serialize_unit_variant("CredentialsType", 5u32, "KerberosKeytab"), - Self::KerberosPassword => serializer.serialize_unit_variant("CredentialsType", 6u32, "KerberosPassword"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The workflow trigger cron for ComputeStartStop schedule type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Cron { - #[doc = "The start time in yyyy-MM-ddTHH:mm:ss format."] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option, - #[doc = "[Required] Specifies cron expression of schedule.\r\nThe expression should follow NCronTab format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub expression: Option, -} -impl Cron { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CronTrigger { - #[serde(flatten)] - pub trigger_base: TriggerBase, - #[doc = "[Required] Specifies cron expression of schedule.\r\nThe expression should follow NCronTab format."] - pub expression: String, -} -impl CronTrigger { - pub fn new(trigger_base: TriggerBase, expression: String) -> Self { - Self { trigger_base, expression } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CsvExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CsvExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} -#[doc = "The desired maximum forecast horizon in units of time-series frequency."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomForecastHorizon { - #[serde(flatten)] - pub forecast_horizon: ForecastHorizon, - #[doc = "[Required] Forecast horizon value."] - pub value: i32, -} -impl CustomForecastHorizon { - pub fn new(forecast_horizon: ForecastHorizon, value: i32) -> Self { - Self { forecast_horizon, value } - } -} -#[doc = "Custom inference server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Online inference configuration options."] - #[serde(rename = "inferenceConfiguration", default, skip_serializing_if = "Option::is_none")] - pub inference_configuration: Option, -} -impl CustomInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - inference_configuration: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomMetricThreshold { - #[doc = "[Required] The user-defined metric to calculate."] - pub metric: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl CustomMetricThreshold { - pub fn new(metric: String) -> Self { - Self { metric, threshold: None } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl CustomModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomModelJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl CustomModelJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[doc = "[Required] ARM resource ID of the component resource used to calculate the custom metrics."] - #[serde(rename = "componentId")] - pub component_id: String, - #[doc = "Monitoring assets to take as input. Key is the component input port name, value is the data asset."] - #[serde(rename = "inputAssets", default, skip_serializing_if = "Option::is_none")] - pub input_assets: Option, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, -} -impl CustomMonitoringSignal { - pub fn new(monitoring_signal_base: MonitoringSignalBase, component_id: String, metric_thresholds: Vec) -> Self { - Self { - monitoring_signal_base, - component_id, - input_assets: None, - metric_thresholds, - } - } -} -#[doc = "N-Cross validations are specified by user."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomNCrossValidations { - #[serde(flatten)] - pub n_cross_validations: NCrossValidations, - #[doc = "[Required] N-Cross validations value."] - pub value: i32, -} -impl CustomNCrossValidations { - pub fn new(n_cross_validations: NCrossValidations, value: i32) -> Self { - Self { - n_cross_validations, - value, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomSeasonality { - #[serde(flatten)] - pub seasonality: Seasonality, - #[doc = "[Required] Seasonality value."] - pub value: i32, -} -impl CustomSeasonality { - pub fn new(seasonality: Seasonality, value: i32) -> Self { - Self { seasonality, value } - } -} -#[doc = "Specifies the custom service configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CustomService { - #[doc = "Name of the Custom Service"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[doc = "Environment Variable for the container"] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub docker: Option, - #[doc = "Configuring the endpoints for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoints: Vec, - #[doc = "Configuring the volumes for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub volumes: Vec, -} -impl CustomService { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomTargetLags { - #[serde(flatten)] - pub target_lags: TargetLags, - #[doc = "[Required] Set target lags values."] - pub values: Vec, -} -impl CustomTargetLags { - pub fn new(target_lags: TargetLags, values: Vec) -> Self { - Self { target_lags, values } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomTargetRollingWindowSize { - #[serde(flatten)] - pub target_rolling_window_size: TargetRollingWindowSize, - #[doc = "[Required] TargetRollingWindowSize value."] - pub value: i32, -} -impl CustomTargetRollingWindowSize { - pub fn new(target_rolling_window_size: TargetRollingWindowSize, value: i32) -> Self { - Self { - target_rolling_window_size, - value, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DataCollectionMode")] -pub enum DataCollectionMode { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DataCollectionMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DataCollectionMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DataCollectionMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("DataCollectionMode", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("DataCollectionMode", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataCollector { - #[doc = "[Required] The collection configuration. Each collection has it own configuration to collect model data and the name of collection can be arbitrary string.\r\nModel data collector can be used for either payload logging or custom logging or both of them. Collection request and response are reserved for payload logging, others are for custom logging."] - pub collections: serde_json::Value, - #[serde(rename = "requestLogging", default, skip_serializing_if = "Option::is_none")] - pub request_logging: Option, - #[serde(rename = "rollingRate", default, skip_serializing_if = "Option::is_none")] - pub rolling_rate: Option, -} -impl DataCollector { - pub fn new(collections: serde_json::Value) -> Self { - Self { - collections, - request_logging: None, - rolling_rate: None, - } - } -} -#[doc = "Container for data asset versions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Enum to determine the type of data."] - #[serde(rename = "dataType")] - pub data_type: DataType, -} -impl DataContainer { - pub fn new(data_type: DataType) -> Self { - Self { - asset_container: AssetContainer::default(), - data_type, - } - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Container for data asset versions."] - pub properties: DataContainer, -} -impl DataContainerResource { - pub fn new(properties: DataContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of DataContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of DataContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type DataContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DataContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DataContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataDriftMetricThresholdBase { - #[serde(rename = "dataType")] - pub data_type: MonitoringFeatureDataType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl DataDriftMetricThresholdBase { - pub fn new(data_type: MonitoringFeatureDataType) -> Self { - Self { - data_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum DataDriftMetricThresholdBaseUnion { - Categorical(CategoricalDataDriftMetricThreshold), - Numerical(NumericalDataDriftMetricThreshold), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataDriftMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "baselineData")] - pub baseline_data: MonitoringInputData, - #[serde(rename = "dataSegment", default, skip_serializing_if = "Option::is_none")] - pub data_segment: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub features: Option, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[serde(rename = "targetData")] - pub target_data: MonitoringInputData, -} -impl DataDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - baseline_data: MonitoringInputData, - metric_thresholds: Vec, - target_data: MonitoringInputData, - ) -> Self { - Self { - monitoring_signal_base, - baseline_data, - data_segment: None, - features: None, - metric_thresholds, - target_data, - } - } -} -#[doc = "A DataFactory compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataFactory { - #[serde(flatten)] - pub compute: Compute, -} -impl DataFactory { - pub fn new(compute: Compute) -> Self { - Self { compute } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataImport { - #[serde(flatten)] - pub data_version_base: DataVersionBase, - #[doc = "Name of the asset for data import job to create"] - #[serde(rename = "assetName", default, skip_serializing_if = "Option::is_none")] - pub asset_name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, -} -impl DataImport { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { - data_version_base, - asset_name: None, - source: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataImportSource { - #[doc = "Workspace connection for data import source storage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub connection: Option, - #[doc = "Enum to determine the type of data."] - #[serde(rename = "sourceType")] - pub source_type: DataImportSourceType, -} -impl DataImportSource { - pub fn new(source_type: DataImportSourceType) -> Self { - Self { - connection: None, - source_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "sourceType")] -pub enum DataImportSourceUnion { - #[serde(rename = "database")] - Database(DatabaseSource), - #[serde(rename = "file_system")] - FileSystem(FileSystemSource), -} -#[doc = "Enum to determine the type of data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DataImportSourceType")] -pub enum DataImportSourceType { - #[serde(rename = "database")] - Database, - #[serde(rename = "file_system")] - FileSystem, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DataImportSourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DataImportSourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DataImportSourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Database => serializer.serialize_unit_variant("DataImportSourceType", 0u32, "database"), - Self::FileSystem => serializer.serialize_unit_variant("DataImportSourceType", 1u32, "file_system"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A DataLakeAnalytics compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataLakeAnalytics { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub data_lake_analytics_schema: DataLakeAnalyticsSchema, -} -impl DataLakeAnalytics { - pub fn new(compute: Compute) -> Self { - Self { - compute, - data_lake_analytics_schema: DataLakeAnalyticsSchema::default(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataLakeAnalyticsSchema { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl DataLakeAnalyticsSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod data_lake_analytics_schema { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "DataLake Store Account Name"] - #[serde(rename = "dataLakeStoreAccountName", default, skip_serializing_if = "Option::is_none")] - pub data_lake_store_account_name: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Reference to an asset via its path in a datastore."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataPathAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "ARM resource ID of the datastore where the asset is located."] - #[serde(rename = "datastoreId", default, skip_serializing_if = "Option::is_none")] - pub datastore_id: Option, - #[doc = "The path of the file/directory in the datastore."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl DataPathAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase) -> Self { - Self { - asset_reference_base, - datastore_id: None, - path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataQualityMetricThresholdBase { - #[serde(rename = "dataType")] - pub data_type: MonitoringFeatureDataType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl DataQualityMetricThresholdBase { - pub fn new(data_type: MonitoringFeatureDataType) -> Self { - Self { - data_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum DataQualityMetricThresholdBaseUnion { - Categorical(CategoricalDataQualityMetricThreshold), - Numerical(NumericalDataQualityMetricThreshold), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataQualityMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "baselineData")] - pub baseline_data: MonitoringInputData, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub features: Option, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[serde(rename = "targetData")] - pub target_data: MonitoringInputData, -} -impl DataQualityMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - baseline_data: MonitoringInputData, - metric_thresholds: Vec, - target_data: MonitoringInputData, - ) -> Self { - Self { - monitoring_signal_base, - baseline_data, - features: None, - metric_thresholds, - target_data, - } - } -} -#[doc = "Enum to determine the type of data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DataType")] -pub enum DataType { - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("DataType", 0u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("DataType", 1u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("DataType", 2u32, "mltable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Data version base definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataVersionBase { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Enum to determine the type of data."] - #[serde(rename = "dataType")] - pub data_type: DataType, - #[doc = "[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330"] - #[serde(rename = "dataUri")] - pub data_uri: String, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "Stage in the data lifecycle assigned to this data asset"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl DataVersionBase { - pub fn new(data_type: DataType, data_uri: String) -> Self { - Self { - asset_base: AssetBase::default(), - data_type, - data_uri, - intellectual_property: None, - stage: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum DataVersionBaseUnion { - #[serde(rename = "uri_folder")] - UriFolder(DataImport), - #[serde(rename = "mltable")] - Mltable(MlTableData), - #[serde(rename = "uri_file")] - UriFile(UriFileDataVersion), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderDataVersion), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataVersionBaseResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Data version base definition"] - pub properties: DataVersionBaseUnion, -} -impl DataVersionBaseResource { - pub fn new(properties: DataVersionBaseUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of DataVersionBase entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataVersionBaseResourceArmPaginatedResult { - #[doc = "The link to the next page of DataVersionBase objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type DataVersionBase."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DataVersionBaseResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DataVersionBaseResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatabaseSource { - #[serde(flatten)] - pub data_import_source: DataImportSource, - #[doc = "SQL Query statement for data import Database source"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option, - #[doc = "SQL StoredProcedure on data import Database source"] - #[serde(rename = "storedProcedure", default, skip_serializing_if = "Option::is_none")] - pub stored_procedure: Option, - #[doc = "SQL StoredProcedure parameters"] - #[serde( - rename = "storedProcedureParams", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub stored_procedure_params: Vec, - #[doc = "Name of the table on data import Database source"] - #[serde(rename = "tableName", default, skip_serializing_if = "Option::is_none")] - pub table_name: Option, -} -impl DatabaseSource { - pub fn new(data_import_source: DataImportSource) -> Self { - Self { - data_import_source, - query: None, - stored_procedure: None, - stored_procedure_params: Vec::new(), - table_name: None, - } - } -} -#[doc = "A DataFactory compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Databricks { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub databricks_schema: DatabricksSchema, -} -impl Databricks { - pub fn new(compute: Compute) -> Self { - Self { - compute, - databricks_schema: DatabricksSchema::default(), - } - } -} -#[doc = "Secrets related to a Machine Learning compute based on Databricks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatabricksComputeSecrets { - #[serde(flatten)] - pub compute_secrets: ComputeSecrets, - #[serde(flatten)] - pub databricks_compute_secrets_properties: DatabricksComputeSecretsProperties, -} -impl DatabricksComputeSecrets { - pub fn new(compute_secrets: ComputeSecrets) -> Self { - Self { - compute_secrets, - databricks_compute_secrets_properties: DatabricksComputeSecretsProperties::default(), - } - } -} -#[doc = "Properties of Databricks Compute Secrets"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabricksComputeSecretsProperties { - #[doc = "access token for databricks account."] - #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] - pub databricks_access_token: Option, -} -impl DatabricksComputeSecretsProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of Databricks"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabricksProperties { - #[doc = "Databricks access token"] - #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] - pub databricks_access_token: Option, - #[doc = "Workspace Url"] - #[serde(rename = "workspaceUrl", default, skip_serializing_if = "Option::is_none")] - pub workspace_url: Option, -} -impl DatabricksProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabricksSchema { - #[doc = "Properties of Databricks"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl DatabricksSchema { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The unique name of the labeled data asset."] - #[serde(rename = "labeledAssetName", default, skip_serializing_if = "Option::is_none")] - pub labeled_asset_name: Option, -} -impl DatasetExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - labeled_asset_name: None, - } - } -} -#[doc = "Base definition for datastore contents configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Datastore { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "Base definition for datastore credentials."] - pub credentials: DatastoreCredentialsUnion, - #[doc = "Enum to determine the datastore contents type."] - #[serde(rename = "datastoreType")] - pub datastore_type: DatastoreType, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "Readonly property to indicate if datastore is the workspace default datastore"] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option, -} -impl Datastore { - pub fn new(credentials: DatastoreCredentialsUnion, datastore_type: DatastoreType) -> Self { - Self { - resource_base: ResourceBase::default(), - credentials, - datastore_type, - intellectual_property: None, - is_default: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "datastoreType")] -pub enum DatastoreUnion { - AzureBlob(AzureBlobDatastore), - AzureDataLakeGen1(AzureDataLakeGen1Datastore), - AzureDataLakeGen2(AzureDataLakeGen2Datastore), - AzureFile(AzureFileDatastore), - Hdfs(HdfsDatastore), - OneLake(OneLakeDatastore), -} -#[doc = "Base definition for datastore credentials."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatastoreCredentials { - #[doc = "Enum to determine the datastore credentials type."] - #[serde(rename = "credentialsType")] - pub credentials_type: CredentialsType, -} -impl DatastoreCredentials { - pub fn new(credentials_type: CredentialsType) -> Self { - Self { credentials_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "credentialsType")] -pub enum DatastoreCredentialsUnion { - AccountKey(AccountKeyDatastoreCredentials), - Certificate(CertificateDatastoreCredentials), - KerberosKeytab(KerberosKeytabCredentials), - KerberosPassword(KerberosPasswordCredentials), - None(NoneDatastoreCredentials), - Sas(SasDatastoreCredentials), - ServicePrincipal(ServicePrincipalDatastoreCredentials), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatastoreResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Base definition for datastore contents configuration."] - pub properties: DatastoreUnion, -} -impl DatastoreResource { - pub fn new(properties: DatastoreUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of Datastore entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatastoreResourceArmPaginatedResult { - #[doc = "The link to the next page of Datastore objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Datastore."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DatastoreResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DatastoreResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Base definition for datastore secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatastoreSecrets { - #[doc = "Enum to determine the datastore secrets type."] - #[serde(rename = "secretsType")] - pub secrets_type: SecretsType, -} -impl DatastoreSecrets { - pub fn new(secrets_type: SecretsType) -> Self { - Self { secrets_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "secretsType")] -pub enum DatastoreSecretsUnion { - AccountKey(AccountKeyDatastoreSecrets), - Certificate(CertificateDatastoreSecrets), - KerberosKeytab(KerberosKeytabSecrets), - KerberosPassword(KerberosPasswordSecrets), - Sas(SasDatastoreSecrets), - ServicePrincipal(ServicePrincipalDatastoreSecrets), -} -#[doc = "Enum to determine the datastore contents type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DatastoreType")] -pub enum DatastoreType { - AzureBlob, - AzureDataLakeGen1, - AzureDataLakeGen2, - AzureFile, - Hdfs, - OneLake, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DatastoreType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DatastoreType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DatastoreType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureBlob => serializer.serialize_unit_variant("DatastoreType", 0u32, "AzureBlob"), - Self::AzureDataLakeGen1 => serializer.serialize_unit_variant("DatastoreType", 1u32, "AzureDataLakeGen1"), - Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("DatastoreType", 2u32, "AzureDataLakeGen2"), - Self::AzureFile => serializer.serialize_unit_variant("DatastoreType", 3u32, "AzureFile"), - Self::Hdfs => serializer.serialize_unit_variant("DatastoreType", 4u32, "Hdfs"), - Self::OneLake => serializer.serialize_unit_variant("DatastoreType", 5u32, "OneLake"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefaultScaleSettings { - #[serde(flatten)] - pub online_scale_settings: OnlineScaleSettings, -} -impl DefaultScaleSettings { - pub fn new(online_scale_settings: OnlineScaleSettings) -> Self { - Self { online_scale_settings } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeploymentLogs { - #[doc = "The retrieved online deployment logs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option, -} -impl DeploymentLogs { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeploymentLogsRequest { - #[doc = "The type of container to retrieve logs from."] - #[serde(rename = "containerType", default, skip_serializing_if = "Option::is_none")] - pub container_type: Option, - #[doc = "The maximum number of lines to tail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tail: Option, -} -impl DeploymentLogsRequest { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Possible values for DeploymentProvisioningState."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DeploymentProvisioningState")] -pub enum DeploymentProvisioningState { - Creating, - Deleting, - Scaling, - Updating, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DeploymentProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DeploymentProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DeploymentProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("DeploymentProvisioningState", 0u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("DeploymentProvisioningState", 1u32, "Deleting"), - Self::Scaling => serializer.serialize_unit_variant("DeploymentProvisioningState", 2u32, "Scaling"), - Self::Updating => serializer.serialize_unit_variant("DeploymentProvisioningState", 3u32, "Updating"), - Self::Succeeded => serializer.serialize_unit_variant("DeploymentProvisioningState", 4u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("DeploymentProvisioningState", 5u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("DeploymentProvisioningState", 6u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeploymentResourceConfiguration { - #[serde(flatten)] - pub resource_configuration: ResourceConfiguration, -} -impl DeploymentResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseRequestProperties { - #[doc = "Setting for diagnosing user defined routing"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub udr: Option, - #[doc = "Setting for diagnosing network security group"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nsg: Option, - #[doc = "Setting for diagnosing resource lock"] - #[serde(rename = "resourceLock", default, skip_serializing_if = "Option::is_none")] - pub resource_lock: Option, - #[doc = "Setting for diagnosing dns resolution"] - #[serde(rename = "dnsResolution", default, skip_serializing_if = "Option::is_none")] - pub dns_resolution: Option, - #[doc = "Setting for diagnosing dependent storage account"] - #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] - pub storage_account: Option, - #[doc = "Setting for diagnosing dependent key vault"] - #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] - pub key_vault: Option, - #[doc = "Setting for diagnosing dependent container registry"] - #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] - pub container_registry: Option, - #[doc = "Setting for diagnosing dependent application insights"] - #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] - pub application_insights: Option, - #[doc = "Setting for diagnosing unclassified category of problems"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub others: Option, -} -impl DiagnoseRequestProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseResponseResult { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl DiagnoseResponseResult { - pub fn new() -> Self { - Self::default() - } -} -pub mod diagnose_response_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Value { - #[serde( - rename = "userDefinedRouteResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub user_defined_route_results: Vec, - #[serde( - rename = "networkSecurityRuleResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub network_security_rule_results: Vec, - #[serde( - rename = "resourceLockResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub resource_lock_results: Vec, - #[serde( - rename = "dnsResolutionResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub dns_resolution_results: Vec, - #[serde( - rename = "storageAccountResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub storage_account_results: Vec, - #[serde( - rename = "keyVaultResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub key_vault_results: Vec, - #[serde( - rename = "containerRegistryResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub container_registry_results: Vec, - #[serde( - rename = "applicationInsightsResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub application_insights_results: Vec, - #[serde( - rename = "otherResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub other_results: Vec, - } - impl Value { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Result of Diagnose"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseResult { - #[doc = "Code for workspace setup error"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Level of workspace setup error"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "Message of workspace setup error"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl DiagnoseResult { - pub fn new() -> Self { - Self::default() - } -} -pub mod diagnose_result { - use super::*; - #[doc = "Level of workspace setup error"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Level")] - pub enum Level { - Warning, - Error, - Information, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Level { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Level { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Level { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Warning => serializer.serialize_unit_variant("Level", 0u32, "Warning"), - Self::Error => serializer.serialize_unit_variant("Level", 1u32, "Error"), - Self::Information => serializer.serialize_unit_variant("Level", 2u32, "Information"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Parameters to diagnose a workspace"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseWorkspaceParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl DiagnoseWorkspaceParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Base definition for job distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DistributionConfiguration { - #[doc = "Enum to determine the job distribution type."] - #[serde(rename = "distributionType")] - pub distribution_type: DistributionType, -} -impl DistributionConfiguration { - pub fn new(distribution_type: DistributionType) -> Self { - Self { distribution_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "distributionType")] -pub enum DistributionConfigurationUnion { - Mpi(Mpi), - PyTorch(PyTorch), - Ray(Ray), - TensorFlow(TensorFlow), -} -#[doc = "Enum to determine the job distribution type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DistributionType")] -pub enum DistributionType { - PyTorch, - TensorFlow, - Mpi, - Ray, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DistributionType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DistributionType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DistributionType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::PyTorch => serializer.serialize_unit_variant("DistributionType", 0u32, "PyTorch"), - Self::TensorFlow => serializer.serialize_unit_variant("DistributionType", 1u32, "TensorFlow"), - Self::Mpi => serializer.serialize_unit_variant("DistributionType", 2u32, "Mpi"), - Self::Ray => serializer.serialize_unit_variant("DistributionType", 3u32, "Ray"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Docker { - #[doc = "Indicate whether container shall run in privileged or non-privileged mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub privileged: Option, -} -impl Docker { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Early termination policies enable canceling poor-performing runs before they complete"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EarlyTerminationPolicy { - #[doc = "Number of intervals by which to delay the first evaluation."] - #[serde(rename = "delayEvaluation", default, skip_serializing_if = "Option::is_none")] - pub delay_evaluation: Option, - #[doc = "Interval (number of runs) between policy evaluations."] - #[serde(rename = "evaluationInterval", default, skip_serializing_if = "Option::is_none")] - pub evaluation_interval: Option, - #[serde(rename = "policyType")] - pub policy_type: EarlyTerminationPolicyType, -} -impl EarlyTerminationPolicy { - pub fn new(policy_type: EarlyTerminationPolicyType) -> Self { - Self { - delay_evaluation: None, - evaluation_interval: None, - policy_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "policyType")] -pub enum EarlyTerminationPolicyUnion { - Bandit(BanditPolicy), - MedianStopping(MedianStoppingPolicy), - TruncationSelection(TruncationSelectionPolicy), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EarlyTerminationPolicyType")] -pub enum EarlyTerminationPolicyType { - Bandit, - MedianStopping, - TruncationSelection, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EarlyTerminationPolicyType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EarlyTerminationPolicyType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EarlyTerminationPolicyType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bandit => serializer.serialize_unit_variant("EarlyTerminationPolicyType", 0u32, "Bandit"), - Self::MedianStopping => serializer.serialize_unit_variant("EarlyTerminationPolicyType", 1u32, "MedianStopping"), - Self::TruncationSelection => serializer.serialize_unit_variant("EarlyTerminationPolicyType", 2u32, "TruncationSelection"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EgressPublicNetworkAccessType")] -pub enum EgressPublicNetworkAccessType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EgressPublicNetworkAccessType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EgressPublicNetworkAccessType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EgressPublicNetworkAccessType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("EgressPublicNetworkAccessType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("EgressPublicNetworkAccessType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EmailMonitoringAlertNotificationSettings { - #[serde(flatten)] - pub monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase, - #[doc = "Configuration for notification."] - #[serde(rename = "emailNotificationSetting", default, skip_serializing_if = "Option::is_none")] - pub email_notification_setting: Option, -} -impl EmailMonitoringAlertNotificationSettings { - pub fn new(monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase) -> Self { - Self { - monitoring_alert_notification_settings_base, - email_notification_setting: None, - } - } -} -#[doc = "Enum to determine the email notification type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EmailNotificationEnableType")] -pub enum EmailNotificationEnableType { - JobCompleted, - JobFailed, - JobCancelled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EmailNotificationEnableType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EmailNotificationEnableType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EmailNotificationEnableType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JobCompleted => serializer.serialize_unit_variant("EmailNotificationEnableType", 0u32, "JobCompleted"), - Self::JobFailed => serializer.serialize_unit_variant("EmailNotificationEnableType", 1u32, "JobFailed"), - Self::JobCancelled => serializer.serialize_unit_variant("EmailNotificationEnableType", 2u32, "JobCancelled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionKeyVaultProperties { - #[doc = "The ArmId of the keyVault where the customer owned encryption key is present."] - #[serde(rename = "keyVaultArmId")] - pub key_vault_arm_id: String, - #[doc = "Key vault uri to access the encryption key."] - #[serde(rename = "keyIdentifier")] - pub key_identifier: String, - #[doc = "For future use - The client id of the identity which will be used to access key vault."] - #[serde(rename = "identityClientId", default, skip_serializing_if = "Option::is_none")] - pub identity_client_id: Option, -} -impl EncryptionKeyVaultProperties { - pub fn new(key_vault_arm_id: String, key_identifier: String) -> Self { - Self { - key_vault_arm_id, - key_identifier, - identity_client_id: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionKeyVaultUpdateProperties { - #[doc = "Key Vault uri to access the encryption key."] - #[serde(rename = "keyIdentifier")] - pub key_identifier: String, -} -impl EncryptionKeyVaultUpdateProperties { - pub fn new(key_identifier: String) -> Self { - Self { key_identifier } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionProperty { - #[doc = "Indicates whether or not the encryption is enabled for the workspace."] - pub status: encryption_property::Status, - #[doc = "Identity that will be used to access key vault for encryption at rest"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[serde(rename = "keyVaultProperties")] - pub key_vault_properties: EncryptionKeyVaultProperties, -} -impl EncryptionProperty { - pub fn new(status: encryption_property::Status, key_vault_properties: EncryptionKeyVaultProperties) -> Self { - Self { - status, - identity: None, - key_vault_properties, - } - } -} -pub mod encryption_property { - use super::*; - #[doc = "Indicates whether or not the encryption is enabled for the workspace."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("Status", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("Status", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionUpdateProperties { - #[serde(rename = "keyVaultProperties")] - pub key_vault_properties: EncryptionKeyVaultUpdateProperties, -} -impl EncryptionUpdateProperties { - pub fn new(key_vault_properties: EncryptionKeyVaultUpdateProperties) -> Self { - Self { key_vault_properties } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Endpoint { - #[doc = "Protocol over which communication will happen over this endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[doc = "Name of the Endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Application port inside the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Port over which the application is exposed from container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub published: Option, - #[doc = "Host IP over which the application is exposed from the container"] - #[serde(rename = "hostIp", default, skip_serializing_if = "Option::is_none")] - pub host_ip: Option, -} -impl Endpoint { - pub fn new() -> Self { - Self::default() - } -} -pub mod endpoint { - use super::*; - #[doc = "Protocol over which communication will happen over this endpoint"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Protocol")] - pub enum Protocol { - #[serde(rename = "tcp")] - Tcp, - #[serde(rename = "udp")] - Udp, - #[serde(rename = "http")] - Http, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Protocol { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Protocol { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Protocol { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "tcp"), - Self::Udp => serializer.serialize_unit_variant("Protocol", 1u32, "udp"), - Self::Http => serializer.serialize_unit_variant("Protocol", 2u32, "http"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Protocol { - fn default() -> Self { - Self::Tcp - } - } -} -#[doc = "Keys for endpoint authentication."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EndpointAuthKeys { - #[doc = "The primary key."] - #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] - pub primary_key: Option, - #[doc = "The secondary key."] - #[serde(rename = "secondaryKey", default, skip_serializing_if = "Option::is_none")] - pub secondary_key: Option, -} -impl EndpointAuthKeys { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to determine endpoint authentication mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointAuthMode")] -pub enum EndpointAuthMode { - #[serde(rename = "AMLToken")] - AmlToken, - Key, - #[serde(rename = "AADToken")] - AadToken, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointAuthMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointAuthMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointAuthMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AmlToken => serializer.serialize_unit_variant("EndpointAuthMode", 0u32, "AMLToken"), - Self::Key => serializer.serialize_unit_variant("EndpointAuthMode", 1u32, "Key"), - Self::AadToken => serializer.serialize_unit_variant("EndpointAuthMode", 2u32, "AADToken"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Service Token"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EndpointAuthToken { - #[doc = "Access token for endpoint authentication."] - #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, - #[doc = "Access token expiry time (UTC)."] - #[serde(rename = "expiryTimeUtc", default, skip_serializing_if = "Option::is_none")] - pub expiry_time_utc: Option, - #[doc = "Refresh access token after time (UTC)."] - #[serde(rename = "refreshAfterTimeUtc", default, skip_serializing_if = "Option::is_none")] - pub refresh_after_time_utc: Option, - #[doc = "Access token type."] - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option, -} -impl EndpointAuthToken { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to determine endpoint compute type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointComputeType")] -pub enum EndpointComputeType { - Managed, - Kubernetes, - #[serde(rename = "AzureMLCompute")] - AzureMlCompute, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointComputeType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointComputeType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointComputeType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Managed => serializer.serialize_unit_variant("EndpointComputeType", 0u32, "Managed"), - Self::Kubernetes => serializer.serialize_unit_variant("EndpointComputeType", 1u32, "Kubernetes"), - Self::AzureMlCompute => serializer.serialize_unit_variant("EndpointComputeType", 2u32, "AzureMLCompute"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition for endpoint deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EndpointDeploymentPropertiesBase { - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, - #[doc = "Description of the endpoint deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "ARM resource ID of the environment specification for the endpoint deployment."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Environment variables configuration for the deployment."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "Property dictionary. Properties can be added, but not removed or altered."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl EndpointDeploymentPropertiesBase { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Inference Endpoint base definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointPropertiesBase { - #[doc = "Enum to determine endpoint authentication mode."] - #[serde(rename = "authMode")] - pub auth_mode: EndpointAuthMode, - #[doc = "Description of the inference endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Keys for endpoint authentication."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub keys: Option, - #[doc = "Property dictionary. Properties can be added, but not removed or altered."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Endpoint URI."] - #[serde(rename = "scoringUri", default, skip_serializing_if = "Option::is_none")] - pub scoring_uri: Option, - #[doc = "Endpoint Swagger URI."] - #[serde(rename = "swaggerUri", default, skip_serializing_if = "Option::is_none")] - pub swagger_uri: Option, -} -impl EndpointPropertiesBase { - pub fn new(auth_mode: EndpointAuthMode) -> Self { - Self { - auth_mode, - description: None, - keys: None, - properties: None, - scoring_uri: None, - swagger_uri: None, - } - } -} -#[doc = "State of endpoint provisioning."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointProvisioningState")] -pub enum EndpointProvisioningState { - Creating, - Deleting, - Succeeded, - Failed, - Updating, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("EndpointProvisioningState", 0u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("EndpointProvisioningState", 1u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("EndpointProvisioningState", 2u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("EndpointProvisioningState", 3u32, "Failed"), - Self::Updating => serializer.serialize_unit_variant("EndpointProvisioningState", 4u32, "Updating"), - Self::Canceled => serializer.serialize_unit_variant("EndpointProvisioningState", 5u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointScheduleAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[doc = "[Required] Defines Schedule action definition details.\r\n"] - #[serde(rename = "endpointInvocationDefinition")] - pub endpoint_invocation_definition: serde_json::Value, -} -impl EndpointScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, endpoint_invocation_definition: serde_json::Value) -> Self { - Self { - schedule_action_base, - endpoint_invocation_definition, - } - } -} -#[doc = "Connection status of the service consumer with the service provider"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointServiceConnectionStatus")] -pub enum EndpointServiceConnectionStatus { - Approved, - Pending, - Rejected, - Disconnected, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointServiceConnectionStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointServiceConnectionStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointServiceConnectionStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Approved => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 0u32, "Approved"), - Self::Pending => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 1u32, "Pending"), - Self::Rejected => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 2u32, "Rejected"), - Self::Disconnected => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 3u32, "Disconnected"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Container for environment specification versions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl EnvironmentContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnvironmentContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Container for environment specification versions."] - pub properties: EnvironmentContainer, -} -impl EnvironmentContainerResource { - pub fn new(properties: EnvironmentContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of EnvironmentContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of EnvironmentContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type EnvironmentContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for EnvironmentContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl EnvironmentContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Environment type is either user created or curated by Azure ML service"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EnvironmentType")] -pub enum EnvironmentType { - Curated, - UserCreated, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EnvironmentType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EnvironmentType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EnvironmentType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Curated => serializer.serialize_unit_variant("EnvironmentType", 0u32, "Curated"), - Self::UserCreated => serializer.serialize_unit_variant("EnvironmentType", 1u32, "UserCreated"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVariable { - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Value of the Environment variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl EnvironmentVariable { - pub fn new() -> Self { - Self::default() - } -} -pub mod environment_variable { - use super::*; - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "local")] - Local, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Local => serializer.serialize_unit_variant("Type", 0u32, "local"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Local - } - } -} -#[doc = "Environment version details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "AutoRebuild setting for the derived image"] - #[serde(rename = "autoRebuild", default, skip_serializing_if = "Option::is_none")] - pub auto_rebuild: Option, - #[doc = "Configuration settings for Docker build context"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option, - #[doc = "Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages.\r\n"] - #[serde(rename = "condaFile", default, skip_serializing_if = "Option::is_none")] - pub conda_file: Option, - #[doc = "Environment type is either user created or curated by Azure ML service"] - #[serde(rename = "environmentType", default, skip_serializing_if = "Option::is_none")] - pub environment_type: Option, - #[doc = "Name of the image that will be used for the environment.\r\n"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[serde(rename = "inferenceConfig", default, skip_serializing_if = "Option::is_none")] - pub inference_config: Option, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "The type of operating system."] - #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] - pub os_type: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Stage in the environment lifecycle assigned to this environment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl EnvironmentVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnvironmentVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Environment version details."] - pub properties: EnvironmentVersion, -} -impl EnvironmentVersionResource { - pub fn new(properties: EnvironmentVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of EnvironmentVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of EnvironmentVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type EnvironmentVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for EnvironmentVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl EnvironmentVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorDetail { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl ErrorDetail { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for ErrorResponse { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The estimated price info for using a VM of a particular OS type, tier, etc."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EstimatedVmPrice { - #[doc = "The price charged for using the VM."] - #[serde(rename = "retailPrice")] - pub retail_price: f64, - #[doc = "Operating system type used by the VM."] - #[serde(rename = "osType")] - pub os_type: estimated_vm_price::OsType, - #[doc = "The type of the VM."] - #[serde(rename = "vmTier")] - pub vm_tier: estimated_vm_price::VmTier, -} -impl EstimatedVmPrice { - pub fn new(retail_price: f64, os_type: estimated_vm_price::OsType, vm_tier: estimated_vm_price::VmTier) -> Self { - Self { - retail_price, - os_type, - vm_tier, - } - } -} -pub mod estimated_vm_price { - use super::*; - #[doc = "Operating system type used by the VM."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OsType")] - pub enum OsType { - Linux, - Windows, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), - Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of the VM."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "VmTier")] - pub enum VmTier { - Standard, - LowPriority, - Spot, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for VmTier { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for VmTier { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for VmTier { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Standard => serializer.serialize_unit_variant("VmTier", 0u32, "Standard"), - Self::LowPriority => serializer.serialize_unit_variant("VmTier", 1u32, "LowPriority"), - Self::Spot => serializer.serialize_unit_variant("VmTier", 2u32, "Spot"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The estimated price info for using a VM."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EstimatedVmPrices { - #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] - #[serde(rename = "billingCurrency")] - pub billing_currency: estimated_vm_prices::BillingCurrency, - #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] - #[serde(rename = "unitOfMeasure")] - pub unit_of_measure: estimated_vm_prices::UnitOfMeasure, - #[doc = "The list of estimated prices for using a VM of a particular OS type, tier, etc."] - pub values: Vec, -} -impl EstimatedVmPrices { - pub fn new( - billing_currency: estimated_vm_prices::BillingCurrency, - unit_of_measure: estimated_vm_prices::UnitOfMeasure, - values: Vec, - ) -> Self { - Self { - billing_currency, - unit_of_measure, - values, - } - } -} -pub mod estimated_vm_prices { - use super::*; - #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "BillingCurrency")] - pub enum BillingCurrency { - #[serde(rename = "USD")] - Usd, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for BillingCurrency { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for BillingCurrency { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for BillingCurrency { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Usd => serializer.serialize_unit_variant("BillingCurrency", 0u32, "USD"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "UnitOfMeasure")] - pub enum UnitOfMeasure { - OneHour, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for UnitOfMeasure { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for UnitOfMeasure { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for UnitOfMeasure { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::OneHour => serializer.serialize_unit_variant("UnitOfMeasure", 0u32, "OneHour"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The format of exported labels."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ExportFormatType")] -pub enum ExportFormatType { - Dataset, - Coco, - #[serde(rename = "CSV")] - Csv, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ExportFormatType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ExportFormatType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ExportFormatType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dataset => serializer.serialize_unit_variant("ExportFormatType", 0u32, "Dataset"), - Self::Coco => serializer.serialize_unit_variant("ExportFormatType", 1u32, "Coco"), - Self::Csv => serializer.serialize_unit_variant("ExportFormatType", 2u32, "CSV"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportSummary { - #[doc = "The time when the export was completed."] - #[serde(rename = "endDateTime", default, with = "azure_core::date::rfc3339::option")] - pub end_date_time: Option, - #[doc = "The total number of labeled datapoints exported."] - #[serde(rename = "exportedRowCount", default, skip_serializing_if = "Option::is_none")] - pub exported_row_count: Option, - #[doc = "The format of exported labels."] - pub format: ExportFormatType, - #[doc = "Name and identifier of the job containing exported labels."] - #[serde(rename = "labelingJobId", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_id: Option, - #[doc = "The time when the export was requested."] - #[serde(rename = "startDateTime", default, with = "azure_core::date::rfc3339::option")] - pub start_date_time: Option, -} -impl ExportSummary { - pub fn new(format: ExportFormatType) -> Self { - Self { - end_date_time: None, - exported_row_count: None, - format, - labeling_job_id: None, - start_date_time: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "format")] -pub enum ExportSummaryUnion { - Coco(CocoExportSummary), - #[serde(rename = "CSV")] - Csv(CsvExportSummary), - Dataset(DatasetExportSummary), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExternalFqdnResponse { - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl ExternalFqdnResponse { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpoint { - #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] - pub domain_name: Option, - #[serde( - rename = "endpointDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoint_details: Vec, -} -impl FqdnEndpoint { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpointDetail { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, -} -impl FqdnEndpointDetail { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpoints { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl FqdnEndpoints { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpointsProperties { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoints: Vec, -} -impl FqdnEndpointsProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Feature { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option, - #[doc = "Specifies name"] - #[serde(rename = "featureName", default, skip_serializing_if = "Option::is_none")] - pub feature_name: Option, -} -impl Feature { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureAttributionDriftMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "baselineData")] - pub baseline_data: MonitoringInputData, - #[serde(rename = "metricThreshold")] - pub metric_threshold: FeatureAttributionMetricThreshold, - #[serde(rename = "modelType")] - pub model_type: MonitoringModelType, - #[serde(rename = "targetData")] - pub target_data: MonitoringInputData, -} -impl FeatureAttributionDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - baseline_data: MonitoringInputData, - metric_threshold: FeatureAttributionMetricThreshold, - model_type: MonitoringModelType, - target_data: MonitoringInputData, - ) -> Self { - Self { - monitoring_signal_base, - baseline_data, - metric_threshold, - model_type, - target_data, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureAttributionMetric")] -pub enum FeatureAttributionMetric { - NormalizedDiscountedCumulativeGain, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeatureAttributionMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeatureAttributionMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeatureAttributionMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NormalizedDiscountedCumulativeGain => { - serializer.serialize_unit_variant("FeatureAttributionMetric", 0u32, "NormalizedDiscountedCumulativeGain") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureAttributionMetricThreshold { - pub metric: FeatureAttributionMetric, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl FeatureAttributionMetricThreshold { - pub fn new(metric: FeatureAttributionMetric) -> Self { - Self { metric, threshold: None } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureDataType")] -pub enum FeatureDataType { - String, - Integer, - Long, - Float, - Double, - Binary, - Datetime, - Boolean, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeatureDataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeatureDataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeatureDataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::String => serializer.serialize_unit_variant("FeatureDataType", 0u32, "String"), - Self::Integer => serializer.serialize_unit_variant("FeatureDataType", 1u32, "Integer"), - Self::Long => serializer.serialize_unit_variant("FeatureDataType", 2u32, "Long"), - Self::Float => serializer.serialize_unit_variant("FeatureDataType", 3u32, "Float"), - Self::Double => serializer.serialize_unit_variant("FeatureDataType", 4u32, "Double"), - Self::Binary => serializer.serialize_unit_variant("FeatureDataType", 5u32, "Binary"), - Self::Datetime => serializer.serialize_unit_variant("FeatureDataType", 6u32, "Datetime"), - Self::Boolean => serializer.serialize_unit_variant("FeatureDataType", 7u32, "Boolean"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Flag for generating lags for the numeric features."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureLags")] -pub enum FeatureLags { - None, - Auto, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeatureLags { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeatureLags { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeatureLags { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("FeatureLags", 0u32, "None"), - Self::Auto => serializer.serialize_unit_variant("FeatureLags", 1u32, "Auto"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature"] - pub properties: Feature, -} -impl FeatureResource { - pub fn new(properties: Feature) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of Feature entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureResourceArmPaginatedResult { - #[doc = "The link to the next page of Feature objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Feature."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeatureResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeatureResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureStoreSettings { - #[serde(rename = "computeRuntime", default, skip_serializing_if = "Option::is_none")] - pub compute_runtime: Option, - #[serde(rename = "offlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub offline_store_connection_name: Option, - #[serde(rename = "onlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub online_store_connection_name: Option, -} -impl FeatureStoreSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureSubset { - #[serde(flatten)] - pub monitoring_feature_filter_base: MonitoringFeatureFilterBase, - #[doc = "[Required] The list of features to include."] - pub features: Vec, -} -impl FeatureSubset { - pub fn new(monitoring_feature_filter_base: MonitoringFeatureFilterBase, features: Vec) -> Self { - Self { - monitoring_feature_filter_base, - features, - } - } -} -#[doc = "Specifies the feature window"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureWindow { - #[doc = "Specifies the feature window end time"] - #[serde(rename = "featureWindowEnd", default, with = "azure_core::date::rfc3339::option")] - pub feature_window_end: Option, - #[doc = "Specifies the feature window start time"] - #[serde(rename = "featureWindowStart", default, with = "azure_core::date::rfc3339::option")] - pub feature_window_start: Option, -} -impl FeatureWindow { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature set"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl FeaturesetContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturesetContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature set"] - pub properties: FeaturesetContainer, -} -impl FeaturesetContainerResource { - pub fn new(properties: FeaturesetContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturesetContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing the feature set job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetJob { - #[doc = "Specifies the created date"] - #[serde(rename = "createdDate", default, with = "azure_core::date::rfc3339::option")] - pub created_date: Option, - #[doc = "Specifies the display name"] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Specifies the duration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option, - #[doc = "Specifies the experiment id"] - #[serde(rename = "experimentId", default, skip_serializing_if = "Option::is_none")] - pub experiment_id: Option, - #[doc = "Specifies the feature window"] - #[serde(rename = "featureWindow", default, skip_serializing_if = "Option::is_none")] - pub feature_window: Option, - #[doc = "Specifies the job id"] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "The status of a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Specifies the tags if any"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl FeaturesetJob { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A paginated list of FeaturesetJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetJobArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetJobArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetJobArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing specification"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetSpecification { - #[doc = "Specifies the spec path"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl FeaturesetSpecification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Specifies list of entities"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub entities: Vec, - #[serde(rename = "materializationSettings", default, skip_serializing_if = "Option::is_none")] - pub materialization_settings: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Dto object representing specification"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub specification: Option, - #[doc = "Specifies the asset stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl FeaturesetVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Request payload for creating a backfill request for a given feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersionBackfillRequest { - #[doc = "Specifies description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Specifies description"] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Specifies the feature window"] - #[serde(rename = "featureWindow", default, skip_serializing_if = "Option::is_none")] - pub feature_window: Option, - #[doc = "Dto object representing compute resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[doc = "Specifies the spark compute settings"] - #[serde(rename = "sparkConfiguration", default, skip_serializing_if = "Option::is_none")] - pub spark_configuration: Option, - #[doc = "Specifies the tags"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl FeaturesetVersionBackfillRequest { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturesetVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature set version"] - pub properties: FeaturesetVersion, -} -impl FeaturesetVersionResource { - pub fn new(properties: FeaturesetVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturesetVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl FeaturestoreEntityContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturestoreEntityContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature entity"] - pub properties: FeaturestoreEntityContainer, -} -impl FeaturestoreEntityContainerResource { - pub fn new(properties: FeaturestoreEntityContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturestoreEntityContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturestoreEntityContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturestoreEntityContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturestoreEntityContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturestoreEntityContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature entity version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Specifies index columns"] - #[serde( - rename = "indexColumns", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub index_columns: Vec, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Specifies the asset stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl FeaturestoreEntityVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturestoreEntityVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature entity version"] - pub properties: FeaturestoreEntityVersion, -} -impl FeaturestoreEntityVersionResource { - pub fn new(properties: FeaturestoreEntityVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturestoreEntityVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturestoreEntityVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturestoreEntityVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturestoreEntityVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturestoreEntityVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeaturestoreJobType")] -pub enum FeaturestoreJobType { - RecurrentMaterialization, - BackfillMaterialization, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeaturestoreJobType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeaturestoreJobType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeaturestoreJobType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::RecurrentMaterialization => serializer.serialize_unit_variant("FeaturestoreJobType", 0u32, "RecurrentMaterialization"), - Self::BackfillMaterialization => serializer.serialize_unit_variant("FeaturestoreJobType", 1u32, "BackfillMaterialization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Featurization mode - determines data featurization mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeaturizationMode")] -pub enum FeaturizationMode { - Auto, - Custom, - Off, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeaturizationMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeaturizationMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeaturizationMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("FeaturizationMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("FeaturizationMode", 1u32, "Custom"), - Self::Off => serializer.serialize_unit_variant("FeaturizationMode", 2u32, "Off"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Featurization Configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturizationSettings { - #[doc = "Dataset language, useful for the text data."] - #[serde(rename = "datasetLanguage", default, skip_serializing_if = "Option::is_none")] - pub dataset_language: Option, -} -impl FeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FileSystemSource { - #[serde(flatten)] - pub data_import_source: DataImportSource, - #[doc = "Path on data import FileSystem source"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl FileSystemSource { - pub fn new(data_import_source: DataImportSource) -> Self { - Self { - data_import_source, - path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FlavorData { - #[doc = "Model flavor-specific data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option, -} -impl FlavorData { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The desired maximum forecast horizon in units of time-series frequency."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ForecastHorizon { - #[doc = "Enum to determine forecast horizon selection mode."] - pub mode: ForecastHorizonMode, -} -impl ForecastHorizon { - pub fn new(mode: ForecastHorizonMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum ForecastHorizonUnion { - Auto(AutoForecastHorizon), - Custom(CustomForecastHorizon), -} -#[doc = "Enum to determine forecast horizon selection mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastHorizonMode")] -pub enum ForecastHorizonMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ForecastHorizonMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ForecastHorizonMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ForecastHorizonMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("ForecastHorizonMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("ForecastHorizonMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Forecasting task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Forecasting { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Forecasting specific parameters."] - #[serde(rename = "forecastingSettings", default, skip_serializing_if = "Option::is_none")] - pub forecasting_settings: Option, - #[doc = "Primary metrics for Forecasting task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Forecasting Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Forecasting { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - forecasting_settings: None, - primary_metric: None, - training_settings: None, - } - } -} -#[doc = "Enum for all forecasting models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastingModels")] -pub enum ForecastingModels { - AutoArima, - Prophet, - Naive, - SeasonalNaive, - Average, - SeasonalAverage, - ExponentialSmoothing, - Arimax, - #[serde(rename = "TCNForecaster")] - TcnForecaster, - ElasticNet, - GradientBoosting, - DecisionTree, - #[serde(rename = "KNN")] - Knn, - LassoLars, - #[serde(rename = "SGD")] - Sgd, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - #[serde(rename = "XGBoostRegressor")] - XgBoostRegressor, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ForecastingModels { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ForecastingModels { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ForecastingModels { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AutoArima => serializer.serialize_unit_variant("ForecastingModels", 0u32, "AutoArima"), - Self::Prophet => serializer.serialize_unit_variant("ForecastingModels", 1u32, "Prophet"), - Self::Naive => serializer.serialize_unit_variant("ForecastingModels", 2u32, "Naive"), - Self::SeasonalNaive => serializer.serialize_unit_variant("ForecastingModels", 3u32, "SeasonalNaive"), - Self::Average => serializer.serialize_unit_variant("ForecastingModels", 4u32, "Average"), - Self::SeasonalAverage => serializer.serialize_unit_variant("ForecastingModels", 5u32, "SeasonalAverage"), - Self::ExponentialSmoothing => serializer.serialize_unit_variant("ForecastingModels", 6u32, "ExponentialSmoothing"), - Self::Arimax => serializer.serialize_unit_variant("ForecastingModels", 7u32, "Arimax"), - Self::TcnForecaster => serializer.serialize_unit_variant("ForecastingModels", 8u32, "TCNForecaster"), - Self::ElasticNet => serializer.serialize_unit_variant("ForecastingModels", 9u32, "ElasticNet"), - Self::GradientBoosting => serializer.serialize_unit_variant("ForecastingModels", 10u32, "GradientBoosting"), - Self::DecisionTree => serializer.serialize_unit_variant("ForecastingModels", 11u32, "DecisionTree"), - Self::Knn => serializer.serialize_unit_variant("ForecastingModels", 12u32, "KNN"), - Self::LassoLars => serializer.serialize_unit_variant("ForecastingModels", 13u32, "LassoLars"), - Self::Sgd => serializer.serialize_unit_variant("ForecastingModels", 14u32, "SGD"), - Self::RandomForest => serializer.serialize_unit_variant("ForecastingModels", 15u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("ForecastingModels", 16u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("ForecastingModels", 17u32, "LightGBM"), - Self::XgBoostRegressor => serializer.serialize_unit_variant("ForecastingModels", 18u32, "XGBoostRegressor"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for Forecasting task."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastingPrimaryMetrics")] -pub enum ForecastingPrimaryMetrics { - SpearmanCorrelation, - NormalizedRootMeanSquaredError, - R2Score, - NormalizedMeanAbsoluteError, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ForecastingPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ForecastingPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ForecastingPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SpearmanCorrelation => serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 0u32, "SpearmanCorrelation"), - Self::NormalizedRootMeanSquaredError => { - serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 1u32, "NormalizedRootMeanSquaredError") - } - Self::R2Score => serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 2u32, "R2Score"), - Self::NormalizedMeanAbsoluteError => { - serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 3u32, "NormalizedMeanAbsoluteError") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Forecasting specific parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastingSettings { - #[doc = "Country or region for holidays for forecasting tasks.\r\nThese should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'."] - #[serde(rename = "countryOrRegionForHolidays", default, skip_serializing_if = "Option::is_none")] - pub country_or_region_for_holidays: Option, - #[doc = "Number of periods between the origin time of one CV fold and the next fold. For\r\nexample, if `CVStepSize` = 3 for daily data, the origin time for each fold will be\r\nthree days apart."] - #[serde(rename = "cvStepSize", default, skip_serializing_if = "Option::is_none")] - pub cv_step_size: Option, - #[doc = "Flag for generating lags for the numeric features."] - #[serde(rename = "featureLags", default, skip_serializing_if = "Option::is_none")] - pub feature_lags: Option, - #[doc = "The feature columns that are available for training but unknown at the time of forecast/inference.\r\nIf features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in the dataset are known at inference time."] - #[serde( - rename = "featuresUnknownAtForecastTime", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub features_unknown_at_forecast_time: Vec, - #[doc = "The desired maximum forecast horizon in units of time-series frequency."] - #[serde(rename = "forecastHorizon", default, skip_serializing_if = "Option::is_none")] - pub forecast_horizon: Option, - #[doc = "When forecasting, this parameter represents the period with which the forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency by default."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub frequency: Option, - #[doc = "Forecasting seasonality."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub seasonality: Option, - #[doc = "The parameter defining how if AutoML should handle short time series."] - #[serde(rename = "shortSeriesHandlingConfig", default, skip_serializing_if = "Option::is_none")] - pub short_series_handling_config: Option, - #[doc = "Target aggregate function."] - #[serde(rename = "targetAggregateFunction", default, skip_serializing_if = "Option::is_none")] - pub target_aggregate_function: Option, - #[doc = "The number of past periods to lag from the target column."] - #[serde(rename = "targetLags", default, skip_serializing_if = "Option::is_none")] - pub target_lags: Option, - #[doc = "Forecasting target rolling window size."] - #[serde(rename = "targetRollingWindowSize", default, skip_serializing_if = "Option::is_none")] - pub target_rolling_window_size: Option, - #[doc = "The name of the time column. This parameter is required when forecasting to specify the datetime column in the input data used for building the time series and inferring its frequency."] - #[serde(rename = "timeColumnName", default, skip_serializing_if = "Option::is_none")] - pub time_column_name: Option, - #[doc = "The names of columns used to group a timeseries. It can be used to create multiple series.\r\nIf grain is not defined, the data set is assumed to be one time-series. This parameter is used with task type forecasting."] - #[serde( - rename = "timeSeriesIdColumnNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub time_series_id_column_names: Vec, - #[doc = "Configure STL Decomposition of the time-series target column."] - #[serde(rename = "useStl", default, skip_serializing_if = "Option::is_none")] - pub use_stl: Option, -} -impl ForecastingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecasting Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastingTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for forecasting task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for forecasting task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl ForecastingTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "FQDN Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FqdnOutboundRule { - #[serde(flatten)] - pub outbound_rule: OutboundRule, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, -} -impl FqdnOutboundRule { - pub fn new(outbound_rule: OutboundRule) -> Self { - Self { - outbound_rule, - destination: None, - } - } -} -#[doc = "Defines supported metric goals for hyperparameter tuning"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "Goal")] -pub enum Goal { - Minimize, - Maximize, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for Goal { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for Goal { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for Goal { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Minimize => serializer.serialize_unit_variant("Goal", 0u32, "Minimize"), - Self::Maximize => serializer.serialize_unit_variant("Goal", 1u32, "Maximize"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Defines a Sampling Algorithm that exhaustively generates every value combination in the space"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GridSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, -} -impl GridSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { sampling_algorithm } - } -} -#[doc = "A HDInsight compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdInsight { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub hd_insight_schema: HdInsightSchema, -} -impl HdInsight { - pub fn new(compute: Compute) -> Self { - Self { - compute, - hd_insight_schema: HdInsightSchema::default(), - } - } -} -#[doc = "HDInsight compute properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HdInsightProperties { - #[doc = "Port open for ssh connections on the master node of the cluster."] - #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] - pub ssh_port: Option, - #[doc = "Public IP address of the master node of the cluster."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - #[doc = "Admin credentials for virtual machine"] - #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] - pub administrator_account: Option, -} -impl HdInsightProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HdInsightSchema { - #[doc = "HDInsight compute properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl HdInsightSchema { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdfsDatastore { - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if \"Https\" protocol is selected."] - #[serde(rename = "hdfsServerCertificate", default, skip_serializing_if = "Option::is_none")] - pub hdfs_server_certificate: Option, - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "nameNodeAddress")] - pub name_node_address: String, - #[doc = "Protocol used to communicate with the storage account (Https/Http)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, -} -impl HdfsDatastore { - pub fn new(datastore: Datastore, name_node_address: String) -> Self { - Self { - datastore, - hdfs_server_certificate: None, - name_node_address, - protocol: None, - } - } -} -#[doc = "Reference to an asset via its ARM resource ID."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "[Required] ARM resource ID of the asset."] - #[serde(rename = "assetId")] - pub asset_id: String, -} -impl IdAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase, asset_id: String) -> Self { - Self { - asset_reference_base, - asset_id, - } - } -} -#[doc = "Base definition for identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdentityConfiguration { - #[doc = "Enum to determine identity framework."] - #[serde(rename = "identityType")] - pub identity_type: IdentityConfigurationType, -} -impl IdentityConfiguration { - pub fn new(identity_type: IdentityConfigurationType) -> Self { - Self { identity_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "identityType")] -pub enum IdentityConfigurationUnion { - #[serde(rename = "AMLToken")] - AmlToken(AmlToken), - Managed(ManagedIdentity), - UserIdentity(UserIdentity), -} -#[doc = "Enum to determine identity framework."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IdentityConfigurationType")] -pub enum IdentityConfigurationType { - Managed, - #[serde(rename = "AMLToken")] - AmlToken, - UserIdentity, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for IdentityConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for IdentityConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for IdentityConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Managed => serializer.serialize_unit_variant("IdentityConfigurationType", 0u32, "Managed"), - Self::AmlToken => serializer.serialize_unit_variant("IdentityConfigurationType", 1u32, "AMLToken"), - Self::UserIdentity => serializer.serialize_unit_variant("IdentityConfigurationType", 2u32, "UserIdentity"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Identity that will be used to access key vault for encryption at rest"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdentityForCmk { - #[doc = "The ArmId of the user assigned identity that will be used to access the customer managed key vault"] - #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identity: Option, -} -impl IdentityForCmk { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Stops compute instance after user defined period of inactivity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdleShutdownSetting { - #[doc = "Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, -} -impl IdleShutdownSetting { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Image { - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Image reference URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reference: Option, -} -impl Image { - pub fn new() -> Self { - Self::default() - } -} -pub mod image { - use super::*; - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "docker")] - Docker, - #[serde(rename = "azureml")] - Azureml, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Docker => serializer.serialize_unit_variant("Type", 0u32, "docker"), - Self::Azureml => serializer.serialize_unit_variant("Type", 1u32, "azureml"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Docker - } - } -} -#[doc = "Annotation type of image data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImageAnnotationType")] -pub enum ImageAnnotationType { - Classification, - BoundingBox, - InstanceSegmentation, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ImageAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ImageAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ImageAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("ImageAnnotationType", 0u32, "Classification"), - Self::BoundingBox => serializer.serialize_unit_variant("ImageAnnotationType", 1u32, "BoundingBox"), - Self::InstanceSegmentation => serializer.serialize_unit_variant("ImageAnnotationType", 2u32, "InstanceSegmentation"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Image Classification. Multi-class image classification is used when an image is classified with only a single label\r\nfrom a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassification { - #[serde(flatten)] - pub image_classification_base: ImageClassificationBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageClassification { - pub fn new(image_classification_base: ImageClassificationBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_classification_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassificationBase { - #[serde(flatten)] - pub image_vertical: ImageVertical, - #[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelSettings", default, skip_serializing_if = "Option::is_none")] - pub model_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, -} -impl ImageClassificationBase { - pub fn new(image_vertical: ImageVertical) -> Self { - Self { - image_vertical, - model_settings: None, - search_space: Vec::new(), - } - } -} -#[doc = "Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels\r\nfrom a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassificationMultilabel { - #[serde(flatten)] - pub image_classification_base: ImageClassificationBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification multilabel tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageClassificationMultilabel { - pub fn new(image_classification_base: ImageClassificationBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_classification_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level,\r\ndrawing a polygon around each object in the image."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageInstanceSegmentation { - #[serde(flatten)] - pub image_object_detection_base: ImageObjectDetectionBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for InstanceSegmentation tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageInstanceSegmentation { - pub fn new(image_object_detection_base: ImageObjectDetectionBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_object_detection_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Limit settings for the AutoML job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageLimitSettings { - #[doc = "Maximum number of concurrent AutoML iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Maximum number of AutoML iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl ImageLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Returns metadata about the operating system image for this compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageMetadata { - #[doc = "Specifies the current operating system image version this compute instance is running on."] - #[serde(rename = "currentImageVersion", default, skip_serializing_if = "Option::is_none")] - pub current_image_version: Option, - #[doc = "Specifies the latest available operating system image version."] - #[serde(rename = "latestImageVersion", default, skip_serializing_if = "Option::is_none")] - pub latest_image_version: Option, - #[doc = "Specifies whether this compute instance is running on the latest operating system image."] - #[serde(rename = "isLatestOsImageVersion", default, skip_serializing_if = "Option::is_none")] - pub is_latest_os_image_version: Option, -} -impl ImageMetadata { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettings { - #[doc = "Enable AMSGrad when optimizer is 'adam' or 'adamw'."] - #[serde(rename = "amsGradient", default, skip_serializing_if = "Option::is_none")] - pub ams_gradient: Option, - #[doc = "Settings for using Augmentations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub augmentations: Option, - #[doc = "Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta1: Option, - #[doc = "Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta2: Option, - #[doc = "Whether to use distributer training."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distributed: Option, - #[doc = "Enable early stopping logic during training."] - #[serde(rename = "earlyStopping", default, skip_serializing_if = "Option::is_none")] - pub early_stopping: Option, - #[doc = "Minimum number of epochs or validation evaluations to wait before primary metric improvement\r\nis tracked for early stopping. Must be a positive integer."] - #[serde(rename = "earlyStoppingDelay", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_delay: Option, - #[doc = "Minimum number of epochs or validation evaluations with no primary metric improvement before\r\nthe run is stopped. Must be a positive integer."] - #[serde(rename = "earlyStoppingPatience", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_patience: Option, - #[doc = "Enable normalization when exporting ONNX model."] - #[serde(rename = "enableOnnxNormalization", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_normalization: Option, - #[doc = "Frequency to evaluate validation dataset to get metric scores. Must be a positive integer."] - #[serde(rename = "evaluationFrequency", default, skip_serializing_if = "Option::is_none")] - pub evaluation_frequency: Option, - #[doc = "Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps without\r\nupdating the model weights while accumulating the gradients of those steps, and then using\r\nthe accumulated gradients to compute the weight updates. Must be a positive integer."] - #[serde(rename = "gradientAccumulationStep", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_step: Option, - #[doc = "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "layersToFreeze", default, skip_serializing_if = "Option::is_none")] - pub layers_to_freeze: Option, - #[doc = "Initial learning rate. Must be a float in the range [0, 1]."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub momentum: Option, - #[doc = "Enable nesterov when optimizer is 'sgd'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nesterov: Option, - #[doc = "Number of training epochs. Must be a positive integer."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "Number of data loader workers. Must be a non-negative integer."] - #[serde(rename = "numberOfWorkers", default, skip_serializing_if = "Option::is_none")] - pub number_of_workers: Option, - #[doc = "Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub optimizer: Option, - #[doc = "Random seed to be used when using deterministic training."] - #[serde(rename = "randomSeed", default, skip_serializing_if = "Option::is_none")] - pub random_seed: Option, - #[doc = "Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]."] - #[serde(rename = "stepLRGamma", default, skip_serializing_if = "Option::is_none")] - pub step_lr_gamma: Option, - #[doc = "Value of step size when learning rate scheduler is 'step'. Must be a positive integer."] - #[serde(rename = "stepLRStepSize", default, skip_serializing_if = "Option::is_none")] - pub step_lr_step_size: Option, - #[doc = "Training batch size. Must be a positive integer."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "Validation batch size. Must be a positive integer."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]."] - #[serde(rename = "warmupCosineLRCycles", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_cycles: Option, - #[doc = "Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer."] - #[serde(rename = "warmupCosineLRWarmupEpochs", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_warmup_epochs: Option, - #[doc = "Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl ImageModelDistributionSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettingsClassification { - #[serde(flatten)] - pub image_model_distribution_settings: ImageModelDistributionSettings, - #[doc = "Image crop size that is input to the neural network for the training dataset. Must be a positive integer."] - #[serde(rename = "trainingCropSize", default, skip_serializing_if = "Option::is_none")] - pub training_crop_size: Option, - #[doc = "Image crop size that is input to the neural network for the validation dataset. Must be a positive integer."] - #[serde(rename = "validationCropSize", default, skip_serializing_if = "Option::is_none")] - pub validation_crop_size: Option, - #[doc = "Image size to which to resize before cropping for validation dataset. Must be a positive integer."] - #[serde(rename = "validationResizeSize", default, skip_serializing_if = "Option::is_none")] - pub validation_resize_size: Option, - #[doc = "Weighted loss. The accepted values are 0 for no weighted loss.\r\n1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2."] - #[serde(rename = "weightedLoss", default, skip_serializing_if = "Option::is_none")] - pub weighted_loss: Option, -} -impl ImageModelDistributionSettingsClassification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettingsObjectDetection { - #[serde(flatten)] - pub image_model_distribution_settings: ImageModelDistributionSettings, - #[doc = "Maximum number of detections per image, for all classes. Must be a positive integer.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "boxDetectionsPerImage", default, skip_serializing_if = "Option::is_none")] - pub box_detections_per_image: Option, - #[doc = "During inference, only return proposals with a classification score greater than\r\nBoxScoreThreshold. Must be a float in the range[0, 1]."] - #[serde(rename = "boxScoreThreshold", default, skip_serializing_if = "Option::is_none")] - pub box_score_threshold: Option, - #[doc = "Image size for train and validation. Must be a positive integer.\r\nNote: The training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "imageSize", default, skip_serializing_if = "Option::is_none")] - pub image_size: Option, - #[doc = "Maximum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "maxSize", default, skip_serializing_if = "Option::is_none")] - pub max_size: Option, - #[doc = "Minimum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "minSize", default, skip_serializing_if = "Option::is_none")] - pub min_size: Option, - #[doc = "Model size. Must be 'small', 'medium', 'large', or 'xlarge'.\r\nNote: training run may get into CUDA OOM if the model size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "modelSize", default, skip_serializing_if = "Option::is_none")] - pub model_size: Option, - #[doc = "Enable multi-scale image by varying image size by +/- 50%.\r\nNote: training run may get into CUDA OOM if no sufficient GPU memory.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "multiScale", default, skip_serializing_if = "Option::is_none")] - pub multi_scale: Option, - #[doc = "IOU threshold used during inference in NMS post processing. Must be float in the range [0, 1]."] - #[serde(rename = "nmsIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub nms_iou_threshold: Option, - #[doc = "The grid size to use for tiling each image. Note: TileGridSize must not be\r\nNone to enable small object detection logic. A string containing two integers in mxn format.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileGridSize", default, skip_serializing_if = "Option::is_none")] - pub tile_grid_size: Option, - #[doc = "Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileOverlapRatio", default, skip_serializing_if = "Option::is_none")] - pub tile_overlap_ratio: Option, - #[doc = "The IOU threshold to use to perform NMS while merging predictions from tiles and image.\r\nUsed in validation/ inference. Must be float in the range [0, 1].\r\nNote: This settings is not supported for the 'yolov5' algorithm.\r\nNMS: Non-maximum suppression"] - #[serde(rename = "tilePredictionsNmsThreshold", default, skip_serializing_if = "Option::is_none")] - pub tile_predictions_nms_threshold: Option, - #[doc = "IOU threshold to use when computing validation metric. Must be float in the range [0, 1]."] - #[serde(rename = "validationIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub validation_iou_threshold: Option, - #[doc = "Metric computation method to use for validation metrics. Must be 'none', 'coco', 'voc', or 'coco_voc'."] - #[serde(rename = "validationMetricType", default, skip_serializing_if = "Option::is_none")] - pub validation_metric_type: Option, -} -impl ImageModelDistributionSettingsObjectDetection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettings { - #[doc = "Settings for advanced scenarios."] - #[serde(rename = "advancedSettings", default, skip_serializing_if = "Option::is_none")] - pub advanced_settings: Option, - #[doc = "Enable AMSGrad when optimizer is 'adam' or 'adamw'."] - #[serde(rename = "amsGradient", default, skip_serializing_if = "Option::is_none")] - pub ams_gradient: Option, - #[doc = "Settings for using Augmentations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub augmentations: Option, - #[doc = "Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta1: Option, - #[doc = "Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta2: Option, - #[doc = "Frequency to store model checkpoints. Must be a positive integer."] - #[serde(rename = "checkpointFrequency", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_frequency: Option, - #[serde(rename = "checkpointModel", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_model: Option, - #[doc = "The id of a previous run that has a pretrained checkpoint for incremental training."] - #[serde(rename = "checkpointRunId", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_run_id: Option, - #[doc = "Whether to use distributed training."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distributed: Option, - #[doc = "Enable early stopping logic during training."] - #[serde(rename = "earlyStopping", default, skip_serializing_if = "Option::is_none")] - pub early_stopping: Option, - #[doc = "Minimum number of epochs or validation evaluations to wait before primary metric improvement\r\nis tracked for early stopping. Must be a positive integer."] - #[serde(rename = "earlyStoppingDelay", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_delay: Option, - #[doc = "Minimum number of epochs or validation evaluations with no primary metric improvement before\r\nthe run is stopped. Must be a positive integer."] - #[serde(rename = "earlyStoppingPatience", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_patience: Option, - #[doc = "Enable normalization when exporting ONNX model."] - #[serde(rename = "enableOnnxNormalization", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_normalization: Option, - #[doc = "Frequency to evaluate validation dataset to get metric scores. Must be a positive integer."] - #[serde(rename = "evaluationFrequency", default, skip_serializing_if = "Option::is_none")] - pub evaluation_frequency: Option, - #[doc = "Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps without\r\nupdating the model weights while accumulating the gradients of those steps, and then using\r\nthe accumulated gradients to compute the weight updates. Must be a positive integer."] - #[serde(rename = "gradientAccumulationStep", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_step: Option, - #[doc = "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "layersToFreeze", default, skip_serializing_if = "Option::is_none")] - pub layers_to_freeze: Option, - #[doc = "Initial learning rate. Must be a float in the range [0, 1]."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Learning rate scheduler enum."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub momentum: Option, - #[doc = "Enable nesterov when optimizer is 'sgd'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nesterov: Option, - #[doc = "Number of training epochs. Must be a positive integer."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "Number of data loader workers. Must be a non-negative integer."] - #[serde(rename = "numberOfWorkers", default, skip_serializing_if = "Option::is_none")] - pub number_of_workers: Option, - #[doc = "Stochastic optimizer for image models."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub optimizer: Option, - #[doc = "Random seed to be used when using deterministic training."] - #[serde(rename = "randomSeed", default, skip_serializing_if = "Option::is_none")] - pub random_seed: Option, - #[doc = "Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]."] - #[serde(rename = "stepLRGamma", default, skip_serializing_if = "Option::is_none")] - pub step_lr_gamma: Option, - #[doc = "Value of step size when learning rate scheduler is 'step'. Must be a positive integer."] - #[serde(rename = "stepLRStepSize", default, skip_serializing_if = "Option::is_none")] - pub step_lr_step_size: Option, - #[doc = "Training batch size. Must be a positive integer."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "Validation batch size. Must be a positive integer."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]."] - #[serde(rename = "warmupCosineLRCycles", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_cycles: Option, - #[doc = "Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer."] - #[serde(rename = "warmupCosineLRWarmupEpochs", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_warmup_epochs: Option, - #[doc = "Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl ImageModelSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettingsClassification { - #[serde(flatten)] - pub image_model_settings: ImageModelSettings, - #[doc = "Image crop size that is input to the neural network for the training dataset. Must be a positive integer."] - #[serde(rename = "trainingCropSize", default, skip_serializing_if = "Option::is_none")] - pub training_crop_size: Option, - #[doc = "Image crop size that is input to the neural network for the validation dataset. Must be a positive integer."] - #[serde(rename = "validationCropSize", default, skip_serializing_if = "Option::is_none")] - pub validation_crop_size: Option, - #[doc = "Image size to which to resize before cropping for validation dataset. Must be a positive integer."] - #[serde(rename = "validationResizeSize", default, skip_serializing_if = "Option::is_none")] - pub validation_resize_size: Option, - #[doc = "Weighted loss. The accepted values are 0 for no weighted loss.\r\n1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2."] - #[serde(rename = "weightedLoss", default, skip_serializing_if = "Option::is_none")] - pub weighted_loss: Option, -} -impl ImageModelSettingsClassification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettingsObjectDetection { - #[serde(flatten)] - pub image_model_settings: ImageModelSettings, - #[doc = "Maximum number of detections per image, for all classes. Must be a positive integer.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "boxDetectionsPerImage", default, skip_serializing_if = "Option::is_none")] - pub box_detections_per_image: Option, - #[doc = "During inference, only return proposals with a classification score greater than\r\nBoxScoreThreshold. Must be a float in the range[0, 1]."] - #[serde(rename = "boxScoreThreshold", default, skip_serializing_if = "Option::is_none")] - pub box_score_threshold: Option, - #[doc = "Image size for train and validation. Must be a positive integer.\r\nNote: The training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "imageSize", default, skip_serializing_if = "Option::is_none")] - pub image_size: Option, - #[serde(rename = "logTrainingMetrics", default, skip_serializing_if = "Option::is_none")] - pub log_training_metrics: Option, - #[serde(rename = "logValidationLoss", default, skip_serializing_if = "Option::is_none")] - pub log_validation_loss: Option, - #[doc = "Maximum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "maxSize", default, skip_serializing_if = "Option::is_none")] - pub max_size: Option, - #[doc = "Minimum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "minSize", default, skip_serializing_if = "Option::is_none")] - pub min_size: Option, - #[doc = "Image model size."] - #[serde(rename = "modelSize", default, skip_serializing_if = "Option::is_none")] - pub model_size: Option, - #[doc = "Enable multi-scale image by varying image size by +/- 50%.\r\nNote: training run may get into CUDA OOM if no sufficient GPU memory.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "multiScale", default, skip_serializing_if = "Option::is_none")] - pub multi_scale: Option, - #[doc = "IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1]."] - #[serde(rename = "nmsIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub nms_iou_threshold: Option, - #[doc = "The grid size to use for tiling each image. Note: TileGridSize must not be\r\nNone to enable small object detection logic. A string containing two integers in mxn format.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileGridSize", default, skip_serializing_if = "Option::is_none")] - pub tile_grid_size: Option, - #[doc = "Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileOverlapRatio", default, skip_serializing_if = "Option::is_none")] - pub tile_overlap_ratio: Option, - #[doc = "The IOU threshold to use to perform NMS while merging predictions from tiles and image.\r\nUsed in validation/ inference. Must be float in the range [0, 1].\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tilePredictionsNmsThreshold", default, skip_serializing_if = "Option::is_none")] - pub tile_predictions_nms_threshold: Option, - #[doc = "IOU threshold to use when computing validation metric. Must be float in the range [0, 1]."] - #[serde(rename = "validationIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub validation_iou_threshold: Option, - #[doc = "Metric computation method to use for validation metrics in image tasks."] - #[serde(rename = "validationMetricType", default, skip_serializing_if = "Option::is_none")] - pub validation_metric_type: Option, -} -impl ImageModelSettingsObjectDetection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Image Object Detection. Object detection is used to identify objects in an image and locate each object with a\r\nbounding box e.g. locate all dogs and cats in an image and draw a bounding box around each."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageObjectDetection { - #[serde(flatten)] - pub image_object_detection_base: ImageObjectDetectionBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for Image ObjectDetection task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageObjectDetection { - pub fn new(image_object_detection_base: ImageObjectDetectionBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_object_detection_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageObjectDetectionBase { - #[serde(flatten)] - pub image_vertical: ImageVertical, - #[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelSettings", default, skip_serializing_if = "Option::is_none")] - pub model_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, -} -impl ImageObjectDetectionBase { - pub fn new(image_vertical: ImageVertical) -> Self { - Self { - image_vertical, - model_settings: None, - search_space: Vec::new(), - } - } -} -#[doc = "Model sweeping and hyperparameter sweeping related settings."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl ImageSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for AutoML tasks that train image (computer vision) models -\r\nsuch as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageVertical { - #[doc = "Limit settings for the AutoML job."] - #[serde(rename = "limitSettings")] - pub limit_settings: ImageLimitSettings, - #[doc = "Model sweeping and hyperparameter sweeping related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, - #[doc = "The fraction of training dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "validationDataSize", default, skip_serializing_if = "Option::is_none")] - pub validation_data_size: Option, -} -impl ImageVertical { - pub fn new(limit_settings: ImageLimitSettings) -> Self { - Self { - limit_settings, - sweep_settings: None, - validation_data: None, - validation_data_size: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImportDataAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[serde(rename = "dataImportDefinition")] - pub data_import_definition: DataImport, -} -impl ImportDataAction { - pub fn new(schedule_action_base: ScheduleActionBase, data_import_definition: DataImport) -> Self { - Self { - schedule_action_base, - data_import_definition, - } - } -} -#[doc = "Whether IncrementalDataRefresh is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IncrementalDataRefresh")] -pub enum IncrementalDataRefresh { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for IncrementalDataRefresh { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for IncrementalDataRefresh { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for IncrementalDataRefresh { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Dto object representing index column"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IndexColumn { - #[doc = "Specifies the column name"] - #[serde(rename = "columnName", default, skip_serializing_if = "Option::is_none")] - pub column_name: Option, - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option, -} -impl IndexColumn { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InferenceContainerProperties { - #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] - pub liveness_route: Option, - #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] - pub readiness_route: Option, - #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] - pub scoring_route: Option, -} -impl InferenceContainerProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct InferencingServer { - #[doc = "Inferencing server type for various targets."] - #[serde(rename = "serverType")] - pub server_type: InferencingServerType, -} -impl InferencingServer { - pub fn new(server_type: InferencingServerType) -> Self { - Self { server_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "serverType")] -pub enum InferencingServerUnion { - #[serde(rename = "AzureMLBatch")] - AzureMlBatch(AzureMlBatchInferencingServer), - #[serde(rename = "AzureMLOnline")] - AzureMlOnline(AzureMlOnlineInferencingServer), - Custom(CustomInferencingServer), - Triton(TritonInferencingServer), -} -#[doc = "Inferencing server type for various targets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InferencingServerType")] -pub enum InferencingServerType { - #[serde(rename = "AzureMLOnline")] - AzureMlOnline, - #[serde(rename = "AzureMLBatch")] - AzureMlBatch, - Triton, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InferencingServerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InferencingServerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InferencingServerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureMlOnline => serializer.serialize_unit_variant("InferencingServerType", 0u32, "AzureMLOnline"), - Self::AzureMlBatch => serializer.serialize_unit_variant("InferencingServerType", 1u32, "AzureMLBatch"), - Self::Triton => serializer.serialize_unit_variant("InferencingServerType", 2u32, "Triton"), - Self::Custom => serializer.serialize_unit_variant("InferencingServerType", 3u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the input data delivery mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InputDeliveryMode")] -pub enum InputDeliveryMode { - ReadOnlyMount, - ReadWriteMount, - Download, - Direct, - EvalMount, - EvalDownload, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadOnlyMount => serializer.serialize_unit_variant("InputDeliveryMode", 0u32, "ReadOnlyMount"), - Self::ReadWriteMount => serializer.serialize_unit_variant("InputDeliveryMode", 1u32, "ReadWriteMount"), - Self::Download => serializer.serialize_unit_variant("InputDeliveryMode", 2u32, "Download"), - Self::Direct => serializer.serialize_unit_variant("InputDeliveryMode", 3u32, "Direct"), - Self::EvalMount => serializer.serialize_unit_variant("InputDeliveryMode", 4u32, "EvalMount"), - Self::EvalDownload => serializer.serialize_unit_variant("InputDeliveryMode", 5u32, "EvalDownload"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Input path type for package inputs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InputPathType")] -pub enum InputPathType { - Url, - PathId, - PathVersion, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InputPathType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InputPathType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InputPathType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Url => serializer.serialize_unit_variant("InputPathType", 0u32, "Url"), - Self::PathId => serializer.serialize_unit_variant("InputPathType", 1u32, "PathId"), - Self::PathVersion => serializer.serialize_unit_variant("InputPathType", 2u32, "PathVersion"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Resource requests/limits for this instance type"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InstanceResourceSchema {} -impl InstanceResourceSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Primary metrics for InstanceSegmentation tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InstanceSegmentationPrimaryMetrics")] -pub enum InstanceSegmentationPrimaryMetrics { - MeanAveragePrecision, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InstanceSegmentationPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InstanceSegmentationPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InstanceSegmentationPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAveragePrecision => { - serializer.serialize_unit_variant("InstanceSegmentationPrimaryMetrics", 0u32, "MeanAveragePrecision") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Instance type schema."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InstanceTypeSchema { - #[doc = "Node Selector"] - #[serde(rename = "nodeSelector", default, skip_serializing_if = "Option::is_none")] - pub node_selector: Option, - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl InstanceTypeSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod instance_type_schema { - use super::*; - #[doc = "Resource requests/limits for this instance type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Resources { - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requests: Option, - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, - } - impl Resources { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Intellectual Property details for a resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IntellectualProperty { - #[doc = "Protection level associated with the Intellectual Property."] - #[serde(rename = "protectionLevel", default, skip_serializing_if = "Option::is_none")] - pub protection_level: Option, - #[doc = "[Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name."] - pub publisher: String, -} -impl IntellectualProperty { - pub fn new(publisher: String) -> Self { - Self { - protection_level: None, - publisher, - } - } -} -#[doc = "Isolation mode for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IsolationMode")] -pub enum IsolationMode { - Disabled, - AllowInternetOutbound, - AllowOnlyApprovedOutbound, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for IsolationMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for IsolationMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for IsolationMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("IsolationMode", 0u32, "Disabled"), - Self::AllowInternetOutbound => serializer.serialize_unit_variant("IsolationMode", 1u32, "AllowInternetOutbound"), - Self::AllowOnlyApprovedOutbound => serializer.serialize_unit_variant("IsolationMode", 2u32, "AllowOnlyApprovedOutbound"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition for a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobBase { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "ARM resource ID of the component resource."] - #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] - pub component_id: Option, - #[doc = "ARM resource ID of the compute resource."] - #[serde(rename = "computeId", default, skip_serializing_if = "Option::is_none")] - pub compute_id: Option, - #[doc = "Display name of job."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The name of the experiment the job belongs to. If not set, the job is placed in the \"Default\" experiment."] - #[serde(rename = "experimentName", default, skip_serializing_if = "Option::is_none")] - pub experiment_name: Option, - #[doc = "Base definition for identity configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Is the asset archived?"] - #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] - pub is_archived: Option, - #[doc = "Enum to determine the type of job."] - #[serde(rename = "jobType")] - pub job_type: JobType, - #[doc = "Configuration for notification."] - #[serde(rename = "notificationSetting", default, skip_serializing_if = "Option::is_none")] - pub notification_setting: Option, - #[doc = "Configuration for secrets to be made available during runtime."] - #[serde(rename = "secretsConfiguration", default, skip_serializing_if = "Option::is_none")] - pub secrets_configuration: Option, - #[doc = "List of JobEndpoints.\r\nFor local jobs, a job endpoint will have an endpoint value of FileStreamObject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub services: Option, - #[doc = "The status of a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl JobBase { - pub fn new(job_type: JobType) -> Self { - Self { - resource_base: ResourceBase::default(), - component_id: None, - compute_id: None, - display_name: None, - experiment_name: None, - identity: None, - is_archived: None, - job_type, - notification_setting: None, - secrets_configuration: None, - services: None, - status: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobType")] -pub enum JobBaseUnion { - #[serde(rename = "AutoML")] - AutoMl(AutoMlJob), - Command(CommandJob), - Labeling(LabelingJob), - Pipeline(PipelineJob), - Spark(SparkJob), - Sweep(SweepJob), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobBaseResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Base definition for a job."] - pub properties: JobBaseUnion, -} -impl JobBaseResource { - pub fn new(properties: JobBaseUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of JobBase entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobBaseResourceArmPaginatedResult { - #[doc = "The link to the next page of JobBase objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type JobBase."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for JobBaseResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl JobBaseResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Command job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobInput { - #[doc = "Description for the input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Enum to determine the Job Input Type."] - #[serde(rename = "jobInputType")] - pub job_input_type: JobInputType, -} -impl JobInput { - pub fn new(job_input_type: JobInputType) -> Self { - Self { - description: None, - job_input_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobInputType")] -pub enum JobInputUnion { - #[serde(rename = "custom_model")] - CustomModel(CustomModelJobInput), - #[serde(rename = "literal")] - Literal(LiteralJobInput), - #[serde(rename = "mlflow_model")] - MlflowModel(MlFlowModelJobInput), - #[serde(rename = "mltable")] - Mltable(MlTableJobInput), - #[serde(rename = "triton_model")] - TritonModel(TritonModelJobInput), - #[serde(rename = "uri_file")] - UriFile(UriFileJobInput), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderJobInput), -} -#[doc = "Enum to determine the Job Input Type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobInputType")] -pub enum JobInputType { - #[serde(rename = "literal")] - Literal, - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(rename = "custom_model")] - CustomModel, - #[serde(rename = "mlflow_model")] - MlflowModel, - #[serde(rename = "triton_model")] - TritonModel, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobInputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobInputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobInputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Literal => serializer.serialize_unit_variant("JobInputType", 0u32, "literal"), - Self::UriFile => serializer.serialize_unit_variant("JobInputType", 1u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("JobInputType", 2u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("JobInputType", 3u32, "mltable"), - Self::CustomModel => serializer.serialize_unit_variant("JobInputType", 4u32, "custom_model"), - Self::MlflowModel => serializer.serialize_unit_variant("JobInputType", 5u32, "mlflow_model"), - Self::TritonModel => serializer.serialize_unit_variant("JobInputType", 6u32, "triton_model"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobLimits { - #[serde(rename = "jobLimitsType")] - pub job_limits_type: JobLimitsType, - #[doc = "The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl JobLimits { - pub fn new(job_limits_type: JobLimitsType) -> Self { - Self { - job_limits_type, - timeout: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobLimitsType")] -pub enum JobLimitsUnion { - Command(CommandJobLimits), - Sweep(SweepJobLimits), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobLimitsType")] -pub enum JobLimitsType { - Command, - Sweep, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobLimitsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobLimitsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobLimitsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Command => serializer.serialize_unit_variant("JobLimitsType", 0u32, "Command"), - Self::Sweep => serializer.serialize_unit_variant("JobLimitsType", 1u32, "Sweep"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Job output definition container information on where to find job output/logs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobOutput { - #[doc = "Description for the output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Enum to determine the Job Output Type."] - #[serde(rename = "jobOutputType")] - pub job_output_type: JobOutputType, -} -impl JobOutput { - pub fn new(job_output_type: JobOutputType) -> Self { - Self { - description: None, - job_output_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobOutputType")] -pub enum JobOutputUnion { - #[serde(rename = "custom_model")] - CustomModel(CustomModelJobOutput), - #[serde(rename = "mlflow_model")] - MlflowModel(MlFlowModelJobOutput), - #[serde(rename = "mltable")] - Mltable(MlTableJobOutput), - #[serde(rename = "triton_model")] - TritonModel(TritonModelJobOutput), - #[serde(rename = "uri_file")] - UriFile(UriFileJobOutput), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderJobOutput), -} -#[doc = "Enum to determine the Job Output Type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobOutputType")] -pub enum JobOutputType { - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(rename = "custom_model")] - CustomModel, - #[serde(rename = "mlflow_model")] - MlflowModel, - #[serde(rename = "triton_model")] - TritonModel, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobOutputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobOutputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobOutputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("JobOutputType", 0u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("JobOutputType", 1u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("JobOutputType", 2u32, "mltable"), - Self::CustomModel => serializer.serialize_unit_variant("JobOutputType", 3u32, "custom_model"), - Self::MlflowModel => serializer.serialize_unit_variant("JobOutputType", 4u32, "mlflow_model"), - Self::TritonModel => serializer.serialize_unit_variant("JobOutputType", 5u32, "triton_model"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the job provisioning state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobProvisioningState")] -pub enum JobProvisioningState { - Succeeded, - Failed, - Canceled, - InProgress, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("JobProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("JobProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobProvisioningState", 2u32, "Canceled"), - Self::InProgress => serializer.serialize_unit_variant("JobProvisioningState", 3u32, "InProgress"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobResourceConfiguration { - #[serde(flatten)] - pub resource_configuration: ResourceConfiguration, - #[doc = "Extra arguments to pass to the Docker run command. This would override any parameters that have already been set by the system, or in this section. This parameter is only supported for Azure ML compute types."] - #[serde(rename = "dockerArgs", default, skip_serializing_if = "Option::is_none")] - pub docker_args: Option, - #[doc = "Size of the docker container's shared memory block. This should be in the format of (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes)."] - #[serde(rename = "shmSize", default, skip_serializing_if = "Option::is_none")] - pub shm_size: Option, -} -impl JobResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobScheduleAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[doc = "Base definition for a job."] - #[serde(rename = "jobDefinition")] - pub job_definition: JobBaseUnion, -} -impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBaseUnion) -> Self { - Self { - schedule_action_base, - job_definition, - } - } -} -#[doc = "Job endpoint definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobService { - #[doc = "Url for endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "Any error in the service."] - #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[doc = "Endpoint type."] - #[serde(rename = "jobServiceType", default, skip_serializing_if = "Option::is_none")] - pub job_service_type: Option, - #[doc = "Abstract Nodes definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nodes: Option, - #[doc = "Port for endpoint set by user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "Additional properties to set on the endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Status of endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl JobService { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The status of a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobStatus")] -pub enum JobStatus { - NotStarted, - Starting, - Provisioning, - Preparing, - Queued, - Running, - Finalizing, - CancelRequested, - Completed, - Failed, - Canceled, - NotResponding, - Paused, - Unknown, - Scheduled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotStarted => serializer.serialize_unit_variant("JobStatus", 0u32, "NotStarted"), - Self::Starting => serializer.serialize_unit_variant("JobStatus", 1u32, "Starting"), - Self::Provisioning => serializer.serialize_unit_variant("JobStatus", 2u32, "Provisioning"), - Self::Preparing => serializer.serialize_unit_variant("JobStatus", 3u32, "Preparing"), - Self::Queued => serializer.serialize_unit_variant("JobStatus", 4u32, "Queued"), - Self::Running => serializer.serialize_unit_variant("JobStatus", 5u32, "Running"), - Self::Finalizing => serializer.serialize_unit_variant("JobStatus", 6u32, "Finalizing"), - Self::CancelRequested => serializer.serialize_unit_variant("JobStatus", 7u32, "CancelRequested"), - Self::Completed => serializer.serialize_unit_variant("JobStatus", 8u32, "Completed"), - Self::Failed => serializer.serialize_unit_variant("JobStatus", 9u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobStatus", 10u32, "Canceled"), - Self::NotResponding => serializer.serialize_unit_variant("JobStatus", 11u32, "NotResponding"), - Self::Paused => serializer.serialize_unit_variant("JobStatus", 12u32, "Paused"), - Self::Unknown => serializer.serialize_unit_variant("JobStatus", 13u32, "Unknown"), - Self::Scheduled => serializer.serialize_unit_variant("JobStatus", 14u32, "Scheduled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the job tier."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobTier")] -pub enum JobTier { - Spot, - Basic, - Standard, - Premium, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobTier { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobTier { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobTier { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Spot => serializer.serialize_unit_variant("JobTier", 0u32, "Spot"), - Self::Basic => serializer.serialize_unit_variant("JobTier", 1u32, "Basic"), - Self::Standard => serializer.serialize_unit_variant("JobTier", 2u32, "Standard"), - Self::Premium => serializer.serialize_unit_variant("JobTier", 3u32, "Premium"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the type of job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobType")] -pub enum JobType { - #[serde(rename = "AutoML")] - AutoMl, - Command, - Labeling, - Sweep, - Pipeline, - Spark, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AutoMl => serializer.serialize_unit_variant("JobType", 0u32, "AutoML"), - Self::Command => serializer.serialize_unit_variant("JobType", 1u32, "Command"), - Self::Labeling => serializer.serialize_unit_variant("JobType", 2u32, "Labeling"), - Self::Sweep => serializer.serialize_unit_variant("JobType", 3u32, "Sweep"), - Self::Pipeline => serializer.serialize_unit_variant("JobType", 4u32, "Pipeline"), - Self::Spark => serializer.serialize_unit_variant("JobType", 5u32, "Spark"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosCredentials { - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "kerberosKdcAddress")] - pub kerberos_kdc_address: String, - #[doc = "[Required] Kerberos Username"] - #[serde(rename = "kerberosPrincipal")] - pub kerberos_principal: String, - #[doc = "[Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service."] - #[serde(rename = "kerberosRealm")] - pub kerberos_realm: String, -} -impl KerberosCredentials { - pub fn new(kerberos_kdc_address: String, kerberos_principal: String, kerberos_realm: String) -> Self { - Self { - kerberos_kdc_address, - kerberos_principal, - kerberos_realm, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosKeytabSecrets, -} -impl KerberosKeytabCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosKeytabSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos keytab secret."] - #[serde(rename = "kerberosKeytab", default, skip_serializing_if = "Option::is_none")] - pub kerberos_keytab: Option, -} -impl KerberosKeytabSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_keytab: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosPasswordSecrets, -} -impl KerberosPasswordCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosPasswordSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos password secret."] - #[serde(rename = "kerberosPassword", default, skip_serializing_if = "Option::is_none")] - pub kerberos_password: Option, -} -impl KerberosPasswordSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_password: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "KeyType")] -pub enum KeyType { - Primary, - Secondary, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for KeyType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for KeyType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for KeyType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Primary => serializer.serialize_unit_variant("KeyType", 0u32, "Primary"), - Self::Secondary => serializer.serialize_unit_variant("KeyType", 1u32, "Secondary"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A Machine Learning compute based on Kubernetes Compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Kubernetes { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub kubernetes_schema: KubernetesSchema, -} -impl Kubernetes { - pub fn new(compute: Compute) -> Self { - Self { - compute, - kubernetes_schema: KubernetesSchema::default(), - } - } -} -#[doc = "Properties specific to a KubernetesOnlineDeployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KubernetesOnlineDeployment { - #[serde(flatten)] - pub online_deployment: OnlineDeployment, - #[doc = "Resource requirements for each container instance within an online deployment."] - #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] - pub container_resource_requirements: Option, -} -impl KubernetesOnlineDeployment { - pub fn new(online_deployment: OnlineDeployment) -> Self { - Self { - online_deployment, - container_resource_requirements: None, - } - } -} -#[doc = "Kubernetes properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KubernetesProperties { - #[doc = "Relay connection string."] - #[serde(rename = "relayConnectionString", default, skip_serializing_if = "Option::is_none")] - pub relay_connection_string: Option, - #[doc = "ServiceBus connection string."] - #[serde(rename = "serviceBusConnectionString", default, skip_serializing_if = "Option::is_none")] - pub service_bus_connection_string: Option, - #[doc = "Extension principal-id."] - #[serde(rename = "extensionPrincipalId", default, skip_serializing_if = "Option::is_none")] - pub extension_principal_id: Option, - #[doc = "Extension instance release train."] - #[serde(rename = "extensionInstanceReleaseTrain", default, skip_serializing_if = "Option::is_none")] - pub extension_instance_release_train: Option, - #[doc = "VC name."] - #[serde(rename = "vcName", default, skip_serializing_if = "Option::is_none")] - pub vc_name: Option, - #[doc = "Compute namespace"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, - #[doc = "Default instance type"] - #[serde(rename = "defaultInstanceType", default, skip_serializing_if = "Option::is_none")] - pub default_instance_type: Option, - #[doc = "Instance Type Schema"] - #[serde(rename = "instanceTypes", default, skip_serializing_if = "Option::is_none")] - pub instance_types: Option, -} -impl KubernetesProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Kubernetes Compute Schema"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KubernetesSchema { - #[doc = "Kubernetes properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl KubernetesSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label category definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelCategory { - #[doc = "Dictionary of label classes in this category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub classes: Option, - #[doc = "Display name of the label category."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Whether multiSelect is enabled"] - #[serde(rename = "multiSelect", default, skip_serializing_if = "Option::is_none")] - pub multi_select: Option, -} -impl LabelCategory { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label class definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelClass { - #[doc = "Display name of the label class."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Dictionary of subclasses of the label class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subclasses: Option, -} -impl LabelClass { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling data configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingDataConfiguration { - #[doc = "Resource Id of the data asset to perform labeling."] - #[serde(rename = "dataId", default, skip_serializing_if = "Option::is_none")] - pub data_id: Option, - #[doc = "Whether IncrementalDataRefresh is enabled"] - #[serde(rename = "incrementalDataRefresh", default, skip_serializing_if = "Option::is_none")] - pub incremental_data_refresh: Option, -} -impl LabelingDataConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling job definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Created time of the job in UTC timezone."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[doc = "Labeling data configuration definition"] - #[serde(rename = "dataConfiguration", default, skip_serializing_if = "Option::is_none")] - pub data_configuration: Option, - #[doc = "Instructions for labeling job"] - #[serde(rename = "jobInstructions", default, skip_serializing_if = "Option::is_none")] - pub job_instructions: Option, - #[doc = "Label categories of the job."] - #[serde(rename = "labelCategories", default, skip_serializing_if = "Option::is_none")] - pub label_categories: Option, - #[doc = "Properties of a labeling job"] - #[serde(rename = "labelingJobMediaProperties", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_media_properties: Option, - #[doc = "Labeling MLAssist configuration definition"] - #[serde(rename = "mlAssistConfiguration", default, skip_serializing_if = "Option::is_none")] - pub ml_assist_configuration: Option, - #[doc = "Progress metrics definition"] - #[serde(rename = "progressMetrics", default, skip_serializing_if = "Option::is_none")] - pub progress_metrics: Option, - #[doc = "Internal id of the job(Previously called project)."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option, - #[doc = "Enum to determine the job provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Status messages of the job."] - #[serde( - rename = "statusMessages", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub status_messages: Vec, -} -impl LabelingJob { - pub fn new(job_base: JobBase) -> Self { - Self { - job_base, - created_date_time: None, - data_configuration: None, - job_instructions: None, - label_categories: None, - labeling_job_media_properties: None, - ml_assist_configuration: None, - progress_metrics: None, - project_id: None, - provisioning_state: None, - status_messages: Vec::new(), - } - } -} -#[doc = "Properties of a labeling job for image data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobImageProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of image data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobImageProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[doc = "Instructions for labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobInstructions { - #[doc = "The link to a page with detailed labeling instructions for labelers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, -} -impl LabelingJobInstructions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobMediaProperties { - #[doc = "Media type of data asset."] - #[serde(rename = "mediaType")] - pub media_type: MediaType, -} -impl LabelingJobMediaProperties { - pub fn new(media_type: MediaType) -> Self { - Self { media_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mediaType")] -pub enum LabelingJobMediaPropertiesUnion { - Image(LabelingJobImageProperties), - Text(LabelingJobTextProperties), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Labeling job definition"] - pub properties: LabelingJob, -} -impl LabelingJobResource { - pub fn new(properties: LabelingJob) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of LabelingJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobResourceArmPaginatedResult { - #[doc = "The link to the next page of LabelingJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type LabelingJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for LabelingJobResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl LabelingJobResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job for text data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobTextProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of text data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobTextProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LakeHouseArtifact { - #[serde(flatten)] - pub one_lake_artifact: OneLakeArtifact, -} -impl LakeHouseArtifact { - pub fn new(one_lake_artifact: OneLakeArtifact) -> Self { - Self { one_lake_artifact } - } -} -#[doc = "Learning rate scheduler enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LearningRateScheduler")] -pub enum LearningRateScheduler { - None, - WarmupCosine, - Step, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("LearningRateScheduler", 0u32, "None"), - Self::WarmupCosine => serializer.serialize_unit_variant("LearningRateScheduler", 1u32, "WarmupCosine"), - Self::Step => serializer.serialize_unit_variant("LearningRateScheduler", 2u32, "Step"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The List Aml user feature operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListAmlUserFeatureResult { - #[doc = "The list of AML user facing features."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListAmlUserFeatureResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListAmlUserFeatureResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListNotebookKeysResult { - #[serde(rename = "primaryAccessKey", default, skip_serializing_if = "Option::is_none")] - pub primary_access_key: Option, - #[serde(rename = "secondaryAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secondary_access_key: Option, -} -impl ListNotebookKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListStorageAccountKeysResult { - #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] - pub user_storage_key: Option, -} -impl ListStorageAccountKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List Usages operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListUsagesResult { - #[doc = "The list of AML resource usages."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListUsagesResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListUsagesResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ListViewType")] -pub enum ListViewType { - ActiveOnly, - ArchivedOnly, - All, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ListViewType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ListViewType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ListViewType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ActiveOnly => serializer.serialize_unit_variant("ListViewType", 0u32, "ActiveOnly"), - Self::ArchivedOnly => serializer.serialize_unit_variant("ListViewType", 1u32, "ArchivedOnly"), - Self::All => serializer.serialize_unit_variant("ListViewType", 2u32, "All"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListWorkspaceKeysResult { - #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] - pub user_storage_key: Option, - #[serde(rename = "userStorageResourceId", default, skip_serializing_if = "Option::is_none")] - pub user_storage_resource_id: Option, - #[serde(rename = "appInsightsInstrumentationKey", default, skip_serializing_if = "Option::is_none")] - pub app_insights_instrumentation_key: Option, - #[serde(rename = "containerRegistryCredentials", default, skip_serializing_if = "Option::is_none")] - pub container_registry_credentials: Option, - #[serde(rename = "notebookAccessKeys", default, skip_serializing_if = "Option::is_none")] - pub notebook_access_keys: Option, -} -impl ListWorkspaceKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List WorkspaceQuotasByVMFamily operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListWorkspaceQuotas { - #[doc = "The list of Workspace Quotas by VM Family"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListWorkspaceQuotas { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListWorkspaceQuotas { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Literal input type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LiteralJobInput { - #[serde(flatten)] - pub job_input: JobInput, - #[doc = "[Required] Literal value for the input."] - pub value: String, -} -impl LiteralJobInput { - pub fn new(job_input: JobInput, value: String) -> Self { - Self { job_input, value } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LogTrainingMetrics")] -pub enum LogTrainingMetrics { - Enable, - Disable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LogTrainingMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LogTrainingMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LogTrainingMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enable => serializer.serialize_unit_variant("LogTrainingMetrics", 0u32, "Enable"), - Self::Disable => serializer.serialize_unit_variant("LogTrainingMetrics", 1u32, "Disable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LogValidationLoss")] -pub enum LogValidationLoss { - Enable, - Disable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LogValidationLoss { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LogValidationLoss { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LogValidationLoss { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enable => serializer.serialize_unit_variant("LogValidationLoss", 0u32, "Enable"), - Self::Disable => serializer.serialize_unit_variant("LogValidationLoss", 1u32, "Disable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum for setting log verbosity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LogVerbosity")] -pub enum LogVerbosity { - NotSet, - Debug, - Info, - Warning, - Error, - Critical, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LogVerbosity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LogVerbosity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LogVerbosity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotSet => serializer.serialize_unit_variant("LogVerbosity", 0u32, "NotSet"), - Self::Debug => serializer.serialize_unit_variant("LogVerbosity", 1u32, "Debug"), - Self::Info => serializer.serialize_unit_variant("LogVerbosity", 2u32, "Info"), - Self::Warning => serializer.serialize_unit_variant("LogVerbosity", 3u32, "Warning"), - Self::Error => serializer.serialize_unit_variant("LogVerbosity", 4u32, "Error"), - Self::Critical => serializer.serialize_unit_variant("LogVerbosity", 5u32, "Critical"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Labeling MLAssist configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfiguration { - #[serde(rename = "mlAssist")] - pub ml_assist: MlAssistConfigurationType, -} -impl MlAssistConfiguration { - pub fn new(ml_assist: MlAssistConfigurationType) -> Self { - Self { ml_assist } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mlAssist")] -pub enum MlAssistConfigurationUnion { - Disabled(MlAssistConfigurationDisabled), - Enabled(MlAssistConfigurationEnabled), -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is disabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationDisabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, -} -impl MlAssistConfigurationDisabled { - pub fn new(ml_assist_configuration: MlAssistConfiguration) -> Self { - Self { ml_assist_configuration } - } -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationEnabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, - #[doc = "[Required] AML compute binding used in inferencing."] - #[serde(rename = "inferencingComputeBinding")] - pub inferencing_compute_binding: String, - #[doc = "[Required] AML compute binding used in training."] - #[serde(rename = "trainingComputeBinding")] - pub training_compute_binding: String, -} -impl MlAssistConfigurationEnabled { - pub fn new( - ml_assist_configuration: MlAssistConfiguration, - inferencing_compute_binding: String, - training_compute_binding: String, - ) -> Self { - Self { - ml_assist_configuration, - inferencing_compute_binding, - training_compute_binding, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlAssistConfigurationType")] -pub enum MlAssistConfigurationType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlAssistConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlAssistConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlAssistConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the state of mlflow autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlFlowAutologgerState")] -pub enum MlFlowAutologgerState { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlFlowAutologgerState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlFlowAutologgerState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlFlowAutologgerState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlFlowModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl MlFlowModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlFlowModelJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl MlFlowModelJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "MLTable data definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableData { - #[serde(flatten)] - pub data_version_base: DataVersionBase, - #[doc = "Uris referenced in the MLTable definition (required for lineage)"] - #[serde( - rename = "referencedUris", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub referenced_uris: Vec, -} -impl MlTableData { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { - data_version_base, - referenced_uris: Vec::new(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl MlTableJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl MlTableJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "Managed identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedIdentity { - #[serde(flatten)] - pub identity_configuration: IdentityConfiguration, - #[doc = "Specifies a user-assigned identity by client ID. For system-assigned, do not set this field."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[doc = "Specifies a user-assigned identity by object ID. For system-assigned, do not set this field."] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option, - #[doc = "Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not set this field."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl ManagedIdentity { - pub fn new(identity_configuration: IdentityConfiguration) -> Self { - Self { - identity_configuration, - client_id: None, - object_id: None, - resource_id: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedIdentityAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ManagedIdentityAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Managed Network Provisioning options for managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedNetworkProvisionOptions { - #[serde(rename = "includeSpark", default, skip_serializing_if = "Option::is_none")] - pub include_spark: Option, -} -impl ManagedNetworkProvisionOptions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Status of the Provisioning for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedNetworkProvisionStatus { - #[doc = "Status for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[serde(rename = "sparkReady", default, skip_serializing_if = "Option::is_none")] - pub spark_ready: Option, -} -impl ManagedNetworkProvisionStatus { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Managed Network settings for a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedNetworkSettings { - #[doc = "Isolation mode for the managed network of a machine learning workspace."] - #[serde(rename = "isolationMode", default, skip_serializing_if = "Option::is_none")] - pub isolation_mode: Option, - #[serde(rename = "networkId", default, skip_serializing_if = "Option::is_none")] - pub network_id: Option, - #[serde(rename = "outboundRules", default, skip_serializing_if = "Option::is_none")] - pub outbound_rules: Option, - #[doc = "Status of the Provisioning for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl ManagedNetworkSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Status for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ManagedNetworkStatus")] -pub enum ManagedNetworkStatus { - Inactive, - Active, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ManagedNetworkStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ManagedNetworkStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ManagedNetworkStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Inactive => serializer.serialize_unit_variant("ManagedNetworkStatus", 0u32, "Inactive"), - Self::Active => serializer.serialize_unit_variant("ManagedNetworkStatus", 1u32, "Active"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Properties specific to a ManagedOnlineDeployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedOnlineDeployment { - #[serde(flatten)] - pub online_deployment: OnlineDeployment, -} -impl ManagedOnlineDeployment { - pub fn new(online_deployment: OnlineDeployment) -> Self { - Self { online_deployment } - } -} -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedServiceIdentity { - #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] - #[serde(rename = "type")] - pub type_: ManagedServiceIdentityType, - #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] - #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identities: Option, -} -impl ManagedServiceIdentity { - pub fn new(type_: ManagedServiceIdentityType) -> Self { - Self { - principal_id: None, - tenant_id: None, - type_, - user_assigned_identities: None, - } - } -} -#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ManagedServiceIdentityType")] -pub enum ManagedServiceIdentityType { - None, - SystemAssigned, - UserAssigned, - #[serde(rename = "SystemAssigned,UserAssigned")] - SystemAssignedUserAssigned, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ManagedServiceIdentityType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ManagedServiceIdentityType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ManagedServiceIdentityType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), - Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), - Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), - Self::SystemAssignedUserAssigned => { - serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned,UserAssigned") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Dto object representing compute resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MaterializationComputeResource { - #[doc = "Specifies the instance type"] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, -} -impl MaterializationComputeResource { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MaterializationSettings { - #[doc = "Configuration for notification."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub notification: Option, - #[doc = "Dto object representing compute resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, - #[doc = "Specifies the spark compute settings"] - #[serde(rename = "sparkConfiguration", default, skip_serializing_if = "Option::is_none")] - pub spark_configuration: Option, - #[serde(rename = "storeType", default, skip_serializing_if = "Option::is_none")] - pub store_type: Option, -} -impl MaterializationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MaterializationStoreType")] -pub enum MaterializationStoreType { - None, - Online, - Offline, - OnlineAndOffline, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MaterializationStoreType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MaterializationStoreType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MaterializationStoreType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("MaterializationStoreType", 0u32, "None"), - Self::Online => serializer.serialize_unit_variant("MaterializationStoreType", 1u32, "Online"), - Self::Offline => serializer.serialize_unit_variant("MaterializationStoreType", 2u32, "Offline"), - Self::OnlineAndOffline => serializer.serialize_unit_variant("MaterializationStoreType", 3u32, "OnlineAndOffline"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Media type of data asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MediaType")] -pub enum MediaType { - Image, - Text, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MediaType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MediaType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MediaType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Image => serializer.serialize_unit_variant("MediaType", 0u32, "Image"), - Self::Text => serializer.serialize_unit_variant("MediaType", 1u32, "Text"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Defines an early termination policy based on running averages of the primary metric of all runs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MedianStoppingPolicy { - #[serde(flatten)] - pub early_termination_policy: EarlyTerminationPolicy, -} -impl MedianStoppingPolicy { - pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { - Self { early_termination_policy } - } -} -#[doc = "Model configuration options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelConfiguration { - #[doc = "Mounting type of the model or the inputs"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Relative mounting path of the model in the target image."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, -} -impl ModelConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl ModelContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelContainerResource { - #[serde(flatten)] - pub resource: Resource, - pub properties: ModelContainer, -} -impl ModelContainerResource { - pub fn new(properties: ModelContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ModelContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of ModelContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ModelContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ModelContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ModelContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model package input options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelPackageInput { - #[doc = "Type of the inputs."] - #[serde(rename = "inputType")] - pub input_type: PackageInputType, - #[doc = "Mounting type of the model or the inputs"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Relative mount path of the input in the target image."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, - pub path: PackageInputPathBaseUnion, -} -impl ModelPackageInput { - pub fn new(input_type: PackageInputType, path: PackageInputPathBaseUnion) -> Self { - Self { - input_type, - mode: None, - mount_path: None, - path, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelPerformanceMetricThresholdBase { - #[serde(rename = "modelType")] - pub model_type: MonitoringModelType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl ModelPerformanceMetricThresholdBase { - pub fn new(model_type: MonitoringModelType) -> Self { - Self { - model_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "modelType")] -pub enum ModelPerformanceMetricThresholdBaseUnion { - Classification(ClassificationModelPerformanceMetricThreshold), - Regression(RegressionModelPerformanceMetricThreshold), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelPerformanceSignalBase { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "baselineData")] - pub baseline_data: MonitoringInputData, - #[serde(rename = "dataSegment", default, skip_serializing_if = "Option::is_none")] - pub data_segment: Option, - #[serde(rename = "metricThreshold")] - pub metric_threshold: ModelPerformanceMetricThresholdBaseUnion, - #[serde(rename = "targetData")] - pub target_data: MonitoringInputData, -} -impl ModelPerformanceSignalBase { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - baseline_data: MonitoringInputData, - metric_threshold: ModelPerformanceMetricThresholdBaseUnion, - target_data: MonitoringInputData, - ) -> Self { - Self { - monitoring_signal_base, - baseline_data, - data_segment: None, - metric_threshold, - target_data, - } - } -} -#[doc = "Image model size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ModelSize")] -pub enum ModelSize { - None, - Small, - Medium, - Large, - ExtraLarge, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ModelSize { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ModelSize { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ModelSize { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ModelSize", 0u32, "None"), - Self::Small => serializer.serialize_unit_variant("ModelSize", 1u32, "Small"), - Self::Medium => serializer.serialize_unit_variant("ModelSize", 2u32, "Medium"), - Self::Large => serializer.serialize_unit_variant("ModelSize", 3u32, "Large"), - Self::ExtraLarge => serializer.serialize_unit_variant("ModelSize", 4u32, "ExtraLarge"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Model asset version details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Mapping of model flavors to their properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flavors: Option, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "Name of the training job which produced this model"] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option, - #[doc = "The storage format for this entity. Used for NCD."] - #[serde(rename = "modelType", default, skip_serializing_if = "Option::is_none")] - pub model_type: Option, - #[doc = "The URI path to the model contents."] - #[serde(rename = "modelUri", default, skip_serializing_if = "Option::is_none")] - pub model_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Stage in the model lifecycle assigned to this model"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl ModelVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Model asset version details."] - pub properties: ModelVersion, -} -impl ModelVersionResource { - pub fn new(properties: ModelVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ModelVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of ModelVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ModelVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ModelVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ModelVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitorDefinition { - #[serde(rename = "alertNotificationSetting", default, skip_serializing_if = "Option::is_none")] - pub alert_notification_setting: Option, - #[doc = "[Required] The ARM resource ID of the compute resource to run the monitoring job on."] - #[serde(rename = "computeId")] - pub compute_id: String, - #[doc = "The ARM resource ID of either the model or deployment targeted by this monitor."] - #[serde(rename = "monitoringTarget", default, skip_serializing_if = "Option::is_none")] - pub monitoring_target: Option, - #[doc = "[Required] The signals to monitor."] - pub signals: serde_json::Value, -} -impl MonitorDefinition { - pub fn new(compute_id: String, signals: serde_json::Value) -> Self { - Self { - alert_notification_setting: None, - compute_id, - monitoring_target: None, - signals, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringAlertNotificationSettingsBase { - #[serde(rename = "alertNotificationType")] - pub alert_notification_type: MonitoringAlertNotificationType, -} -impl MonitoringAlertNotificationSettingsBase { - pub fn new(alert_notification_type: MonitoringAlertNotificationType) -> Self { - Self { alert_notification_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "alertNotificationType")] -pub enum MonitoringAlertNotificationSettingsBaseUnion { - AzureMonitor(AzMonMonitoringAlertNotificationSettings), - Email(EmailMonitoringAlertNotificationSettings), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringAlertNotificationType")] -pub enum MonitoringAlertNotificationType { - AzureMonitor, - Email, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringAlertNotificationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringAlertNotificationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringAlertNotificationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureMonitor => serializer.serialize_unit_variant("MonitoringAlertNotificationType", 0u32, "AzureMonitor"), - Self::Email => serializer.serialize_unit_variant("MonitoringAlertNotificationType", 1u32, "Email"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MonitoringDataSegment { - #[doc = "The feature to segment the data on."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feature: Option, - #[doc = "Filters for only the specified values of the given segmented feature."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub values: Vec, -} -impl MonitoringDataSegment { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringFeatureDataType")] -pub enum MonitoringFeatureDataType { - Numerical, - Categorical, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringFeatureDataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringFeatureDataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringFeatureDataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Numerical => serializer.serialize_unit_variant("MonitoringFeatureDataType", 0u32, "Numerical"), - Self::Categorical => serializer.serialize_unit_variant("MonitoringFeatureDataType", 1u32, "Categorical"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringFeatureFilterBase { - #[serde(rename = "filterType")] - pub filter_type: MonitoringFeatureFilterType, -} -impl MonitoringFeatureFilterBase { - pub fn new(filter_type: MonitoringFeatureFilterType) -> Self { - Self { filter_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "filterType")] -pub enum MonitoringFeatureFilterBaseUnion { - AllFeatures(AllFeatures), - FeatureSubset(FeatureSubset), - TopNByAttribution(TopNFeaturesByAttribution), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringFeatureFilterType")] -pub enum MonitoringFeatureFilterType { - AllFeatures, - TopNByAttribution, - FeatureSubset, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringFeatureFilterType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringFeatureFilterType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringFeatureFilterType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AllFeatures => serializer.serialize_unit_variant("MonitoringFeatureFilterType", 0u32, "AllFeatures"), - Self::TopNByAttribution => serializer.serialize_unit_variant("MonitoringFeatureFilterType", 1u32, "TopNByAttribution"), - Self::FeatureSubset => serializer.serialize_unit_variant("MonitoringFeatureFilterType", 2u32, "FeatureSubset"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringInputData { - #[doc = "The data asset input to be leveraged by the monitoring job.."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub asset: Option, - #[serde(rename = "dataContext")] - pub data_context: MonitoringInputDataContext, - #[doc = "The ARM resource ID of the component resource used to preprocess the data."] - #[serde(rename = "preprocessingComponentId", default, skip_serializing_if = "Option::is_none")] - pub preprocessing_component_id: Option, - #[doc = "The target column in the given data asset to leverage."] - #[serde(rename = "targetColumnName", default, skip_serializing_if = "Option::is_none")] - pub target_column_name: Option, -} -impl MonitoringInputData { - pub fn new(data_context: MonitoringInputDataContext) -> Self { - Self { - asset: None, - data_context, - preprocessing_component_id: None, - target_column_name: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringInputDataContext")] -pub enum MonitoringInputDataContext { - ModelInputs, - ModelOutputs, - Training, - Test, - Validation, - GroundTruth, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringInputDataContext { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringInputDataContext { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringInputDataContext { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ModelInputs => serializer.serialize_unit_variant("MonitoringInputDataContext", 0u32, "ModelInputs"), - Self::ModelOutputs => serializer.serialize_unit_variant("MonitoringInputDataContext", 1u32, "ModelOutputs"), - Self::Training => serializer.serialize_unit_variant("MonitoringInputDataContext", 2u32, "Training"), - Self::Test => serializer.serialize_unit_variant("MonitoringInputDataContext", 3u32, "Test"), - Self::Validation => serializer.serialize_unit_variant("MonitoringInputDataContext", 4u32, "Validation"), - Self::GroundTruth => serializer.serialize_unit_variant("MonitoringInputDataContext", 5u32, "GroundTruth"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringModelType")] -pub enum MonitoringModelType { - Classification, - Regression, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringModelType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringModelType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringModelType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("MonitoringModelType", 0u32, "Classification"), - Self::Regression => serializer.serialize_unit_variant("MonitoringModelType", 1u32, "Regression"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringNotificationMode")] -pub enum MonitoringNotificationMode { - Disabled, - Enabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringNotificationMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringNotificationMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringNotificationMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("MonitoringNotificationMode", 0u32, "Disabled"), - Self::Enabled => serializer.serialize_unit_variant("MonitoringNotificationMode", 1u32, "Enabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringSignalBase { - #[doc = "The amount of time a single monitor should look back over the target data on a given run."] - #[serde(rename = "lookbackPeriod", default, skip_serializing_if = "Option::is_none")] - pub lookback_period: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[serde(rename = "signalType")] - pub signal_type: MonitoringSignalType, -} -impl MonitoringSignalBase { - pub fn new(signal_type: MonitoringSignalType) -> Self { - Self { - lookback_period: None, - mode: None, - signal_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "signalType")] -pub enum MonitoringSignalBaseUnion { - Custom(CustomMonitoringSignal), - DataDrift(DataDriftMonitoringSignal), - DataQuality(DataQualityMonitoringSignal), - FeatureAttributionDrift(FeatureAttributionDriftMonitoringSignal), - ModelPerformance(ModelPerformanceSignalBase), - PredictionDrift(PredictionDriftMonitoringSignal), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringSignalType")] -pub enum MonitoringSignalType { - DataDrift, - PredictionDrift, - DataQuality, - FeatureAttributionDrift, - Custom, - ModelPerformance, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringSignalType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringSignalType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringSignalType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::DataDrift => serializer.serialize_unit_variant("MonitoringSignalType", 0u32, "DataDrift"), - Self::PredictionDrift => serializer.serialize_unit_variant("MonitoringSignalType", 1u32, "PredictionDrift"), - Self::DataQuality => serializer.serialize_unit_variant("MonitoringSignalType", 2u32, "DataQuality"), - Self::FeatureAttributionDrift => serializer.serialize_unit_variant("MonitoringSignalType", 3u32, "FeatureAttributionDrift"), - Self::Custom => serializer.serialize_unit_variant("MonitoringSignalType", 4u32, "Custom"), - Self::ModelPerformance => serializer.serialize_unit_variant("MonitoringSignalType", 5u32, "ModelPerformance"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MonitoringThreshold { - #[doc = "The threshold value. If null, the set default is dependent on the metric type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl MonitoringThreshold { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "MPI distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Mpi { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of processes per MPI node."] - #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] - pub process_count_per_instance: Option, -} -impl Mpi { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - process_count_per_instance: None, - } - } -} -#[doc = "Whether multiSelect is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MultiSelect")] -pub enum MultiSelect { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MultiSelect { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MultiSelect { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MultiSelect { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MultiSelect", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MultiSelect", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "N-Cross validations value."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NCrossValidations { - #[doc = "Determines how N-Cross validations value is determined."] - pub mode: NCrossValidationsMode, -} -impl NCrossValidations { - pub fn new(mode: NCrossValidationsMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum NCrossValidationsUnion { - Auto(AutoNCrossValidations), - Custom(CustomNCrossValidations), -} -#[doc = "Determines how N-Cross validations value is determined."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NCrossValidationsMode")] -pub enum NCrossValidationsMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NCrossValidationsMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NCrossValidationsMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NCrossValidationsMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("NCrossValidationsMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("NCrossValidationsMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpFixedParameters { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NlpLearningRateScheduler")] -pub enum NlpLearningRateScheduler { - None, - Linear, - Cosine, - CosineWithRestarts, - Polynomial, - Constant, - ConstantWithWarmup, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NlpLearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NlpLearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NlpLearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("NlpLearningRateScheduler", 0u32, "None"), - Self::Linear => serializer.serialize_unit_variant("NlpLearningRateScheduler", 1u32, "Linear"), - Self::Cosine => serializer.serialize_unit_variant("NlpLearningRateScheduler", 2u32, "Cosine"), - Self::CosineWithRestarts => serializer.serialize_unit_variant("NlpLearningRateScheduler", 3u32, "CosineWithRestarts"), - Self::Polynomial => serializer.serialize_unit_variant("NlpLearningRateScheduler", 4u32, "Polynomial"), - Self::Constant => serializer.serialize_unit_variant("NlpLearningRateScheduler", 5u32, "Constant"), - Self::ConstantWithWarmup => serializer.serialize_unit_variant("NlpLearningRateScheduler", 6u32, "ConstantWithWarmup"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stringified search spaces for each parameter. See below examples."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpParameterSubspace { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "The type of learning rate schedule to use during the training procedure."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model sweeping and hyperparameter tuning related settings."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NlpSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl NlpSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for NLP related AutoML tasks.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVertical { - #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] - pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, - #[doc = "Job execution constraints."] - #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] - pub limit_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[doc = "Model sweeping and hyperparameter tuning related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, -} -impl NlpVertical { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVerticalFeaturizationSettings { - #[serde(flatten)] - pub featurization_settings: FeaturizationSettings, -} -impl NlpVerticalFeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Job execution constraints."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVerticalLimitSettings { - #[doc = "Maximum Concurrent AutoML iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, - #[doc = "Number of AutoML iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[doc = "Timeout for individual HD trials."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl NlpVerticalLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Counts of various compute node states on the amlCompute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NodeStateCounts { - #[doc = "Number of compute nodes in idle state."] - #[serde(rename = "idleNodeCount", default, skip_serializing_if = "Option::is_none")] - pub idle_node_count: Option, - #[doc = "Number of compute nodes which are running jobs."] - #[serde(rename = "runningNodeCount", default, skip_serializing_if = "Option::is_none")] - pub running_node_count: Option, - #[doc = "Number of compute nodes which are being prepared."] - #[serde(rename = "preparingNodeCount", default, skip_serializing_if = "Option::is_none")] - pub preparing_node_count: Option, - #[doc = "Number of compute nodes which are in unusable state."] - #[serde(rename = "unusableNodeCount", default, skip_serializing_if = "Option::is_none")] - pub unusable_node_count: Option, - #[doc = "Number of compute nodes which are leaving the amlCompute."] - #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] - pub leaving_node_count: Option, - #[doc = "Number of compute nodes which are in preempted state."] - #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] - pub preempted_node_count: Option, -} -impl NodeStateCounts { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Abstract Nodes definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Nodes { - #[doc = "The enumerated types for the nodes value"] - #[serde(rename = "nodesValueType")] - pub nodes_value_type: NodesValueType, -} -impl Nodes { - pub fn new(nodes_value_type: NodesValueType) -> Self { - Self { nodes_value_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "nodesValueType")] -pub enum NodesUnion { - All(AllNodes), -} -#[doc = "The enumerated types for the nodes value"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NodesValueType")] -pub enum NodesValueType { - All, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NodesValueType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NodesValueType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NodesValueType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::All => serializer.serialize_unit_variant("NodesValueType", 0u32, "All"), - Self::Custom => serializer.serialize_unit_variant("NodesValueType", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NoneAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, -} -impl NoneAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - } - } -} -#[doc = "Empty/none datastore credentials."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NoneDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, -} -impl NoneDatastoreCredentials { - pub fn new(datastore_credentials: DatastoreCredentials) -> Self { - Self { datastore_credentials } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookAccessTokenResult { - #[serde(rename = "notebookResourceId", default, skip_serializing_if = "Option::is_none")] - pub notebook_resource_id: Option, - #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] - pub host_name: Option, - #[serde(rename = "publicDns", default, skip_serializing_if = "Option::is_none")] - pub public_dns: Option, - #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option, - #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] - pub expires_in: Option, - #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] - pub refresh_token: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, -} -impl NotebookAccessTokenResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookPreparationError { - #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[serde(rename = "statusCode", default, skip_serializing_if = "Option::is_none")] - pub status_code: Option, -} -impl NotebookPreparationError { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookResourceInfo { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fqdn: Option, - #[doc = "the data plane resourceId that used to initialize notebook component"] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, - #[serde(rename = "notebookPreparationError", default, skip_serializing_if = "Option::is_none")] - pub notebook_preparation_error: Option, -} -impl NotebookResourceInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration for notification."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotificationSetting { - #[doc = "Send email notification to user on specified notification type"] - #[serde( - rename = "emailOn", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub email_on: Vec, - #[doc = "This is the email recipient list which has a limitation of 499 characters in total concat with comma separator"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub emails: Vec, - #[doc = "Send webhook callback to a service. Key is a user-provided name for the webhook."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub webhooks: Option, -} -impl NotificationSetting { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NumericalDataDriftMetric")] -pub enum NumericalDataDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - NormalizedWassersteinDistance, - TwoSampleKolmogorovSmirnovTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NumericalDataDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NumericalDataDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NumericalDataDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => serializer.serialize_unit_variant("NumericalDataDriftMetric", 0u32, "JensenShannonDistance"), - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("NumericalDataDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::NormalizedWassersteinDistance => { - serializer.serialize_unit_variant("NumericalDataDriftMetric", 2u32, "NormalizedWassersteinDistance") - } - Self::TwoSampleKolmogorovSmirnovTest => { - serializer.serialize_unit_variant("NumericalDataDriftMetric", 3u32, "TwoSampleKolmogorovSmirnovTest") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NumericalDataDriftMetricThreshold { - #[serde(flatten)] - pub data_drift_metric_threshold_base: DataDriftMetricThresholdBase, - pub metric: NumericalDataDriftMetric, -} -impl NumericalDataDriftMetricThreshold { - pub fn new(data_drift_metric_threshold_base: DataDriftMetricThresholdBase, metric: NumericalDataDriftMetric) -> Self { - Self { - data_drift_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NumericalDataQualityMetric")] -pub enum NumericalDataQualityMetric { - NullValueRate, - DataTypeErrorRate, - OutOfBoundsRate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NumericalDataQualityMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NumericalDataQualityMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NumericalDataQualityMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NullValueRate => serializer.serialize_unit_variant("NumericalDataQualityMetric", 0u32, "NullValueRate"), - Self::DataTypeErrorRate => serializer.serialize_unit_variant("NumericalDataQualityMetric", 1u32, "DataTypeErrorRate"), - Self::OutOfBoundsRate => serializer.serialize_unit_variant("NumericalDataQualityMetric", 2u32, "OutOfBoundsRate"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NumericalDataQualityMetricThreshold { - #[serde(flatten)] - pub data_quality_metric_threshold_base: DataQualityMetricThresholdBase, - pub metric: NumericalDataQualityMetric, -} -impl NumericalDataQualityMetricThreshold { - pub fn new(data_quality_metric_threshold_base: DataQualityMetricThresholdBase, metric: NumericalDataQualityMetric) -> Self { - Self { - data_quality_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NumericalPredictionDriftMetric")] -pub enum NumericalPredictionDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - NormalizedWassersteinDistance, - TwoSampleKolmogorovSmirnovTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NumericalPredictionDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NumericalPredictionDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NumericalPredictionDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 0u32, "JensenShannonDistance") - } - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::NormalizedWassersteinDistance => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 2u32, "NormalizedWassersteinDistance") - } - Self::TwoSampleKolmogorovSmirnovTest => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 3u32, "TwoSampleKolmogorovSmirnovTest") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NumericalPredictionDriftMetricThreshold { - #[serde(flatten)] - pub prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, - pub metric: NumericalPredictionDriftMetric, -} -impl NumericalPredictionDriftMetricThreshold { - pub fn new(prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, metric: NumericalPredictionDriftMetric) -> Self { - Self { - prediction_drift_metric_threshold_base, - metric, - } - } -} -#[doc = "Primary metrics for Image ObjectDetection task."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ObjectDetectionPrimaryMetrics")] -pub enum ObjectDetectionPrimaryMetrics { - MeanAveragePrecision, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ObjectDetectionPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ObjectDetectionPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ObjectDetectionPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAveragePrecision => serializer.serialize_unit_variant("ObjectDetectionPrimaryMetrics", 0u32, "MeanAveragePrecision"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Optimization objective."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Objective { - #[doc = "Defines supported metric goals for hyperparameter tuning"] - pub goal: Goal, - #[doc = "[Required] Name of the metric to optimize."] - #[serde(rename = "primaryMetric")] - pub primary_metric: String, -} -impl Objective { - pub fn new(goal: Goal, primary_metric: String) -> Self { - Self { goal, primary_metric } - } -} -#[doc = "OneLake artifact (data source) configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OneLakeArtifact { - #[doc = "[Required] OneLake artifact name"] - #[serde(rename = "artifactName")] - pub artifact_name: String, - #[doc = "Enum to determine OneLake artifact type."] - #[serde(rename = "artifactType")] - pub artifact_type: OneLakeArtifactType, -} -impl OneLakeArtifact { - pub fn new(artifact_name: String, artifact_type: OneLakeArtifactType) -> Self { - Self { - artifact_name, - artifact_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "artifactType")] -pub enum OneLakeArtifactUnion { - LakeHouse(LakeHouseArtifact), -} -#[doc = "Enum to determine OneLake artifact type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OneLakeArtifactType")] -pub enum OneLakeArtifactType { - LakeHouse, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OneLakeArtifactType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OneLakeArtifactType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OneLakeArtifactType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::LakeHouse => serializer.serialize_unit_variant("OneLakeArtifactType", 0u32, "LakeHouse"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "OneLake (Trident) datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OneLakeDatastore { - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "OneLake artifact (data source) configuration."] - pub artifact: OneLakeArtifactUnion, - #[doc = "OneLake endpoint to use for the datastore."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "[Required] OneLake workspace name."] - #[serde(rename = "oneLakeWorkspaceName")] - pub one_lake_workspace_name: String, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl OneLakeDatastore { - pub fn new(datastore: Datastore, artifact: OneLakeArtifactUnion, one_lake_workspace_name: String) -> Self { - Self { - datastore, - artifact, - endpoint: None, - one_lake_workspace_name, - service_data_access_auth_identity: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineDeployment { - #[serde(flatten)] - pub endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase, - #[doc = "If true, enables Application Insights logging."] - #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] - pub app_insights_enabled: Option, - #[serde(rename = "dataCollector", default, skip_serializing_if = "Option::is_none")] - pub data_collector: Option, - #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment."] - #[serde(rename = "egressPublicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub egress_public_network_access: Option, - #[doc = "Enum to determine endpoint compute type."] - #[serde(rename = "endpointComputeType")] - pub endpoint_compute_type: EndpointComputeType, - #[doc = "Compute instance type."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Deployment container liveness/readiness probe configuration."] - #[serde(rename = "livenessProbe", default, skip_serializing_if = "Option::is_none")] - pub liveness_probe: Option, - #[doc = "The URI path to the model."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, - #[doc = "The path to mount the model in custom container."] - #[serde(rename = "modelMountPath", default, skip_serializing_if = "Option::is_none")] - pub model_mount_path: Option, - #[doc = "Possible values for DeploymentProvisioningState."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Deployment container liveness/readiness probe configuration."] - #[serde(rename = "readinessProbe", default, skip_serializing_if = "Option::is_none")] - pub readiness_probe: Option, - #[doc = "Online deployment scoring requests configuration."] - #[serde(rename = "requestSettings", default, skip_serializing_if = "Option::is_none")] - pub request_settings: Option, - #[doc = "Online deployment scaling configuration."] - #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, -} -impl OnlineDeployment { - pub fn new(endpoint_compute_type: EndpointComputeType) -> Self { - Self { - endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase::default(), - app_insights_enabled: None, - data_collector: None, - egress_public_network_access: None, - endpoint_compute_type, - instance_type: None, - liveness_probe: None, - model: None, - model_mount_path: None, - provisioning_state: None, - readiness_probe: None, - request_settings: None, - scale_settings: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "endpointComputeType")] -pub enum OnlineDeploymentUnion { - Kubernetes(KubernetesOnlineDeployment), - Managed(ManagedOnlineDeployment), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineDeploymentTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - pub properties: OnlineDeploymentUnion, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl OnlineDeploymentTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: OnlineDeploymentUnion) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of OnlineDeployment entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineDeploymentTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of OnlineDeployment objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type OnlineDeployment."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for OnlineDeploymentTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OnlineDeploymentTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online endpoint configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineEndpoint { - #[serde(flatten)] - pub endpoint_properties_base: EndpointPropertiesBase, - #[doc = "ARM resource ID of the compute if it exists.\r\noptional"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compute: Option, - #[doc = "Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50."] - #[serde(rename = "mirrorTraffic", default, skip_serializing_if = "Option::is_none")] - pub mirror_traffic: Option, - #[doc = "State of endpoint provisioning."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub traffic: Option, -} -impl OnlineEndpoint { - pub fn new(endpoint_properties_base: EndpointPropertiesBase) -> Self { - Self { - endpoint_properties_base, - compute: None, - mirror_traffic: None, - provisioning_state: None, - public_network_access: None, - traffic: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineEndpointTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Online endpoint configuration"] - pub properties: OnlineEndpoint, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl OnlineEndpointTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: OnlineEndpoint) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of OnlineEndpoint entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineEndpointTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of OnlineEndpoint objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type OnlineEndpoint."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for OnlineEndpointTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OnlineEndpointTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online inference configuration options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineInferenceConfiguration { - #[doc = "Additional configurations"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configurations: Option, - #[doc = "Entry script or command to invoke."] - #[serde(rename = "entryScript", default, skip_serializing_if = "Option::is_none")] - pub entry_script: Option, - #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] - pub liveness_route: Option, - #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] - pub readiness_route: Option, - #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] - pub scoring_route: Option, -} -impl OnlineInferenceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online deployment scoring requests configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineRequestSettings { - #[doc = "The number of maximum concurrent requests per node allowed per deployment. Defaults to 1."] - #[serde(rename = "maxConcurrentRequestsPerInstance", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_requests_per_instance: Option, - #[doc = "The maximum amount of time a request will stay in the queue in ISO 8601 format.\r\nDefaults to 500ms."] - #[serde(rename = "maxQueueWait", default, skip_serializing_if = "Option::is_none")] - pub max_queue_wait: Option, - #[doc = "The scoring timeout in ISO 8601 format.\r\nDefaults to 5000ms."] - #[serde(rename = "requestTimeout", default, skip_serializing_if = "Option::is_none")] - pub request_timeout: Option, -} -impl OnlineRequestSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online deployment scaling configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineScaleSettings { - #[serde(rename = "scaleType")] - pub scale_type: ScaleType, -} -impl OnlineScaleSettings { - pub fn new(scale_type: ScaleType) -> Self { - Self { scale_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "scaleType")] -pub enum OnlineScaleSettingsUnion { - Default(DefaultScaleSettings), - TargetUtilization(TargetUtilizationScaleSettings), -} -#[doc = "The type of operating system."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OperatingSystemType")] -pub enum OperatingSystemType { - Linux, - Windows, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OperatingSystemType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OperatingSystemType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OperatingSystemType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Linux => serializer.serialize_unit_variant("OperatingSystemType", 0u32, "Linux"), - Self::Windows => serializer.serialize_unit_variant("OperatingSystemType", 1u32, "Windows"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OrderString")] -pub enum OrderString { - CreatedAtDesc, - CreatedAtAsc, - UpdatedAtDesc, - UpdatedAtAsc, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OrderString { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OrderString { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OrderString { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreatedAtDesc => serializer.serialize_unit_variant("OrderString", 0u32, "CreatedAtDesc"), - Self::CreatedAtAsc => serializer.serialize_unit_variant("OrderString", 1u32, "CreatedAtAsc"), - Self::UpdatedAtDesc => serializer.serialize_unit_variant("OrderString", 2u32, "UpdatedAtDesc"), - Self::UpdatedAtAsc => serializer.serialize_unit_variant("OrderString", 3u32, "UpdatedAtAsc"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutboundRule { - #[doc = "Type of a managed network Outbound Rule of a machine learning workspace."] - #[serde(rename = "type")] - pub type_: RuleType, - #[doc = "Status of a managed network Outbound Rule of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Category of a managed network Outbound Rule of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, -} -impl OutboundRule { - pub fn new(type_: RuleType) -> Self { - Self { - type_, - status: None, - category: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "type")] -pub enum OutboundRuleUnion { - #[serde(rename = "FQDN")] - Fqdn(FqdnOutboundRule), - PrivateEndpoint(PrivateEndpointOutboundRule), - ServiceTag(ServiceTagOutboundRule), -} -#[doc = "Outbound Rule Basic Resource for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutboundRuleBasicResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Outbound Rule for the managed network of a machine learning workspace."] - pub properties: OutboundRuleUnion, -} -impl OutboundRuleBasicResource { - pub fn new(properties: OutboundRuleUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "List of outbound rules for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OutboundRuleListResult { - #[doc = "The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The link to the next page constructed using the continuationToken. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for OutboundRuleListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OutboundRuleListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Output data delivery mode enums."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OutputDeliveryMode")] -pub enum OutputDeliveryMode { - ReadWriteMount, - Upload, - Direct, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OutputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OutputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OutputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadWriteMount => serializer.serialize_unit_variant("OutputDeliveryMode", 0u32, "ReadWriteMount"), - Self::Upload => serializer.serialize_unit_variant("OutputDeliveryMode", 1u32, "Upload"), - Self::Direct => serializer.serialize_unit_variant("OutputDeliveryMode", 2u32, "Direct"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Reference to an asset via its path in a job output."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutputPathAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "ARM resource ID of the job."] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "The path of the file/directory in the job output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl OutputPathAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase) -> Self { - Self { - asset_reference_base, - job_id: None, - path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl PatAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Package build state returned in package response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageBuildState")] -pub enum PackageBuildState { - NotStarted, - Running, - Succeeded, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageBuildState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageBuildState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageBuildState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotStarted => serializer.serialize_unit_variant("PackageBuildState", 0u32, "NotStarted"), - Self::Running => serializer.serialize_unit_variant("PackageBuildState", 1u32, "Running"), - Self::Succeeded => serializer.serialize_unit_variant("PackageBuildState", 2u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("PackageBuildState", 3u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Mounting type of the model or the inputs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageInputDeliveryMode")] -pub enum PackageInputDeliveryMode { - ReadOnlyMount, - Download, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageInputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageInputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageInputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadOnlyMount => serializer.serialize_unit_variant("PackageInputDeliveryMode", 0u32, "ReadOnlyMount"), - Self::Download => serializer.serialize_unit_variant("PackageInputDeliveryMode", 1u32, "Download"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathBase { - #[doc = "Input path type for package inputs."] - #[serde(rename = "inputPathType")] - pub input_path_type: InputPathType, -} -impl PackageInputPathBase { - pub fn new(input_path_type: InputPathType) -> Self { - Self { input_path_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "inputPathType")] -pub enum PackageInputPathBaseUnion { - PathId(PackageInputPathId), - Url(PackageInputPathUrl), - PathVersion(PackageInputPathVersion), -} -#[doc = "Package input path specified with a resource id."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathId { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input resource id."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl PackageInputPathId { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - resource_id: None, - } - } -} -#[doc = "Package input path specified as an url."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathUrl { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input path url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, -} -impl PackageInputPathUrl { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - url: None, - } - } -} -#[doc = "Package input path specified with name and version."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathVersion { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input resource name."] - #[serde(rename = "resourceName", default, skip_serializing_if = "Option::is_none")] - pub resource_name: Option, - #[doc = "Input resource version."] - #[serde(rename = "resourceVersion", default, skip_serializing_if = "Option::is_none")] - pub resource_version: Option, -} -impl PackageInputPathVersion { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - resource_name: None, - resource_version: None, - } - } -} -#[doc = "Type of the inputs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageInputType")] -pub enum PackageInputType { - UriFile, - UriFolder, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageInputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageInputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageInputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("PackageInputType", 0u32, "UriFile"), - Self::UriFolder => serializer.serialize_unit_variant("PackageInputType", 1u32, "UriFolder"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Model package operation request properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageRequest { - #[serde(rename = "baseEnvironmentSource", default, skip_serializing_if = "Option::is_none")] - pub base_environment_source: Option, - #[doc = "Collection of environment variables."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(rename = "inferencingServer")] - pub inferencing_server: InferencingServerUnion, - #[doc = "Collection of inputs."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub inputs: Vec, - #[doc = "Model configuration options."] - #[serde(rename = "modelConfiguration", default, skip_serializing_if = "Option::is_none")] - pub model_configuration: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "[Required] Target environment name to be generated by package."] - #[serde(rename = "targetEnvironmentName")] - pub target_environment_name: String, - #[doc = "Target environment version to be generated by package."] - #[serde(rename = "targetEnvironmentVersion", default, skip_serializing_if = "Option::is_none")] - pub target_environment_version: Option, -} -impl PackageRequest { - pub fn new(inferencing_server: InferencingServerUnion, target_environment_name: String) -> Self { - Self { - base_environment_source: None, - environment_variables: None, - inferencing_server, - inputs: Vec::new(), - model_configuration: None, - tags: None, - target_environment_name, - target_environment_version: None, - } - } -} -#[doc = "Package response returned after async package operation completes successfully."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PackageResponse { - #[serde(rename = "baseEnvironmentSource", default, skip_serializing_if = "Option::is_none")] - pub base_environment_source: Option, - #[doc = "Build id of the image build operation."] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option, - #[doc = "Package build state returned in package response."] - #[serde(rename = "buildState", default, skip_serializing_if = "Option::is_none")] - pub build_state: Option, - #[doc = "Collection of environment variables."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(rename = "inferencingServer", default, skip_serializing_if = "Option::is_none")] - pub inferencing_server: Option, - #[doc = "Collection of inputs."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub inputs: Vec, - #[doc = "Log url of the image build operation."] - #[serde(rename = "logUrl", default, skip_serializing_if = "Option::is_none")] - pub log_url: Option, - #[doc = "Model configuration options."] - #[serde(rename = "modelConfiguration", default, skip_serializing_if = "Option::is_none")] - pub model_configuration: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "Asset ID of the target environment created by package operation."] - #[serde(rename = "targetEnvironmentId", default, skip_serializing_if = "Option::is_none")] - pub target_environment_id: Option, - #[doc = "Target environment name to be generated by package."] - #[serde(rename = "targetEnvironmentName", default, skip_serializing_if = "Option::is_none")] - pub target_environment_name: Option, - #[doc = "Target environment version to be generated by package."] - #[serde(rename = "targetEnvironmentVersion", default, skip_serializing_if = "Option::is_none")] - pub target_environment_version: Option, -} -impl PackageResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Paginated list of Machine Learning compute objects wrapped in ARM resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PaginatedComputeResourcesList { - #[doc = "An array of Machine Learning compute objects wrapped in ARM resource envelope."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "A continuation link (absolute URI) to the next page of results in the list."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for PaginatedComputeResourcesList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl PaginatedComputeResourcesList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Mutable batch inference settings per deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialBatchDeployment { - #[doc = "Description of the endpoint deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl PartialBatchDeployment { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { - #[doc = "Mutable batch inference settings per deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Mutable base definition for a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialJobBase { - #[doc = "Mutable configuration for notification."] - #[serde(rename = "notificationSetting", default, skip_serializing_if = "Option::is_none")] - pub notification_setting: Option, -} -impl PartialJobBase { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialJobBasePartialResource { - #[doc = "Mutable base definition for a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl PartialJobBasePartialResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialManagedServiceIdentity { - #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] - #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identities: Option, -} -impl PartialManagedServiceIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResource { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialMinimalTrackedResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResourceWithIdentity { - #[serde(flatten)] - pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, -} -impl PartialMinimalTrackedResourceWithIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResourceWithSku { - #[serde(flatten)] - pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, - #[doc = "Common SKU definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl PartialMinimalTrackedResourceWithSku { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Mutable configuration for notification."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialNotificationSetting { - #[doc = "Send webhook callback to a service. Key is a user-provided name for the webhook."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub webhooks: Option, -} -impl PartialNotificationSetting { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Partial Registry class for PATCH"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistry {} -impl PartialRegistry { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistryPartialTrackedResource { - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Common SKU definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialRegistryPartialTrackedResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common SKU definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialSku { - #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, - #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "The name of the SKU. Ex - P3. It is typically a letter+number code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, -} -impl PartialSku { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialUserAssignedIdentity {} -impl PartialUserAssignedIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Password { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl Password { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PendingUploadCredentialDto { - #[doc = "Enum to determine the PendingUpload credentials type."] - #[serde(rename = "credentialType")] - pub credential_type: PendingUploadCredentialType, -} -impl PendingUploadCredentialDto { - pub fn new(credential_type: PendingUploadCredentialType) -> Self { - Self { credential_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "credentialType")] -pub enum PendingUploadCredentialDtoUnion { - #[serde(rename = "SAS")] - Sas(SasCredentialDto), -} -#[doc = "Enum to determine the PendingUpload credentials type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PendingUploadCredentialType")] -pub enum PendingUploadCredentialType { - #[serde(rename = "SAS")] - Sas, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PendingUploadCredentialType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PendingUploadCredentialType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PendingUploadCredentialType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Sas => serializer.serialize_unit_variant("PendingUploadCredentialType", 0u32, "SAS"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PendingUploadRequestDto { - #[doc = "If PendingUploadId = null then random guid will be used."] - #[serde(rename = "pendingUploadId", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_id: Option, - #[doc = "Type of storage to use for the pending upload location"] - #[serde(rename = "pendingUploadType", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_type: Option, -} -impl PendingUploadRequestDto { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PendingUploadResponseDto { - #[serde(rename = "blobReferenceForConsumption", default, skip_serializing_if = "Option::is_none")] - pub blob_reference_for_consumption: Option, - #[doc = "ID for this upload request"] - #[serde(rename = "pendingUploadId", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_id: Option, - #[doc = "Type of storage to use for the pending upload location"] - #[serde(rename = "pendingUploadType", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_type: Option, -} -impl PendingUploadResponseDto { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Type of storage to use for the pending upload location"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PendingUploadType")] -pub enum PendingUploadType { - None, - TemporaryBlobReference, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PendingUploadType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PendingUploadType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PendingUploadType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("PendingUploadType", 0u32, "None"), - Self::TemporaryBlobReference => serializer.serialize_unit_variant("PendingUploadType", 1u32, "TemporaryBlobReference"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Settings for a personal compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PersonalComputeInstanceSettings { - #[doc = "A user that can be assigned to a compute instance."] - #[serde(rename = "assignedUser", default, skip_serializing_if = "Option::is_none")] - pub assigned_user: Option, -} -impl PersonalComputeInstanceSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Pipeline Job definition: defines generic to MFE attributes."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PipelineJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Inputs for the pipeline job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jobs construct the Pipeline Job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jobs: Option, - #[doc = "Outputs for the pipeline job"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Pipeline settings, for things like ContinueRunOnStepFailure etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option, - #[doc = "ARM resource ID of source job."] - #[serde(rename = "sourceJobId", default, skip_serializing_if = "Option::is_none")] - pub source_job_id: Option, -} -impl PipelineJob { - pub fn new(job_base: JobBase) -> Self { - Self { - job_base, - inputs: None, - jobs: None, - outputs: None, - settings: None, - source_job_id: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PredictionDriftMetricThresholdBase { - #[serde(rename = "dataType")] - pub data_type: MonitoringFeatureDataType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl PredictionDriftMetricThresholdBase { - pub fn new(data_type: MonitoringFeatureDataType) -> Self { - Self { - data_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum PredictionDriftMetricThresholdBaseUnion { - Categorical(CategoricalPredictionDriftMetricThreshold), - Numerical(NumericalPredictionDriftMetricThreshold), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PredictionDriftMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "baselineData")] - pub baseline_data: MonitoringInputData, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[serde(rename = "modelType")] - pub model_type: MonitoringModelType, - #[serde(rename = "targetData")] - pub target_data: MonitoringInputData, -} -impl PredictionDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - baseline_data: MonitoringInputData, - metric_thresholds: Vec, - model_type: MonitoringModelType, - target_data: MonitoringInputData, - ) -> Self { - Self { - monitoring_signal_base, - baseline_data, - metric_thresholds, - model_type, - target_data, - } - } -} -#[doc = "The Private Endpoint resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpoint { - #[doc = "The ARM identifier for Private Endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, -} -impl PrivateEndpoint { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The Private Endpoint Connection resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointConnection { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Properties of the PrivateEndpointConnectProperties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Specifies the location of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Contains resource tags defined as key/value pairs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl PrivateEndpointConnection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "List of private endpoint connection associated with the specified workspace"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointConnectionListResult { - #[doc = "Array of private endpoint connections"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for PrivateEndpointConnectionListResult { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl PrivateEndpointConnectionListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of the PrivateEndpointConnectProperties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PrivateEndpointConnectionProperties { - #[doc = "The Private Endpoint resource."] - #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] - pub private_endpoint: Option, - #[doc = "A collection of information about the state of the connection between service consumer and provider."] - #[serde(rename = "privateLinkServiceConnectionState")] - pub private_link_service_connection_state: PrivateLinkServiceConnectionState, - #[doc = "The current provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl PrivateEndpointConnectionProperties { - pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { - Self { - private_endpoint: None, - private_link_service_connection_state, - provisioning_state: None, - } - } -} -#[doc = "The current provisioning state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PrivateEndpointConnectionProvisioningState")] -pub enum PrivateEndpointConnectionProvisioningState { - Succeeded, - Creating, - Deleting, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PrivateEndpointConnectionProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PrivateEndpointConnectionProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), - Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"), - Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointDestination { - #[serde(rename = "serviceResourceId", default, skip_serializing_if = "Option::is_none")] - pub service_resource_id: Option, - #[serde(rename = "subresourceTarget", default, skip_serializing_if = "Option::is_none")] - pub subresource_target: Option, - #[serde(rename = "sparkEnabled", default, skip_serializing_if = "Option::is_none")] - pub spark_enabled: Option, - #[doc = "Status of a managed network Outbound Rule of a machine learning workspace."] - #[serde(rename = "sparkStatus", default, skip_serializing_if = "Option::is_none")] - pub spark_status: Option, -} -impl PrivateEndpointDestination { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Private Endpoint Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PrivateEndpointOutboundRule { - #[serde(flatten)] - pub outbound_rule: OutboundRule, - #[doc = "Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, -} -impl PrivateEndpointOutboundRule { - pub fn new(outbound_rule: OutboundRule) -> Self { - Self { - outbound_rule, - destination: None, - } - } -} -#[doc = "The PE network resource that is linked to this PE connection."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointResource { - #[serde(flatten)] - pub private_endpoint: PrivateEndpoint, - #[doc = "The subnetId that the private endpoint is connected to."] - #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] - pub subnet_arm_id: Option, -} -impl PrivateEndpointResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The private endpoint connection status."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PrivateEndpointServiceConnectionStatus")] -pub enum PrivateEndpointServiceConnectionStatus { - Pending, - Approved, - Rejected, - Disconnected, - Timeout, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PrivateEndpointServiceConnectionStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PrivateEndpointServiceConnectionStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Pending"), - Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Approved"), - Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"), - Self::Disconnected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 3u32, "Disconnected"), - Self::Timeout => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 4u32, "Timeout"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A private link resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Properties of a private link resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Specifies the location of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Contains resource tags defined as key/value pairs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl PrivateLinkResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of private link resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResourceListResult { - #[doc = "Array of private link resources"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl PrivateLinkResourceListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a private link resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResourceProperties { - #[doc = "The private link resource group id."] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option, - #[doc = "The private link resource required member names."] - #[serde( - rename = "requiredMembers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub required_members: Vec, - #[doc = "The private link resource Private link DNS zone name."] - #[serde( - rename = "requiredZoneNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub required_zone_names: Vec, -} -impl PrivateLinkResourceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A collection of information about the state of the connection between service consumer and provider."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkServiceConnectionState { - #[doc = "The private endpoint connection status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The reason for approval/rejection of the connection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "A message indicating if changes on the service provider require any updates on the consumer."] - #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] - pub actions_required: Option, -} -impl PrivateLinkServiceConnectionState { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Deployment container liveness/readiness probe configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProbeSettings { - #[doc = "The number of failures to allow before returning an unhealthy status."] - #[serde(rename = "failureThreshold", default, skip_serializing_if = "Option::is_none")] - pub failure_threshold: Option, - #[doc = "The delay before the first probe in ISO 8601 format."] - #[serde(rename = "initialDelay", default, skip_serializing_if = "Option::is_none")] - pub initial_delay: Option, - #[doc = "The length of time between probes in ISO 8601 format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub period: Option, - #[doc = "The number of successful probes before returning a healthy status."] - #[serde(rename = "successThreshold", default, skip_serializing_if = "Option::is_none")] - pub success_threshold: Option, - #[doc = "The probe timeout in ISO 8601 format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl ProbeSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Progress metrics definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProgressMetrics { - #[doc = "The completed datapoint count."] - #[serde(rename = "completedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub completed_datapoint_count: Option, - #[doc = "The time of last successful incremental data refresh in UTC."] - #[serde(rename = "incrementalDataLastRefreshDateTime", default, with = "azure_core::date::rfc3339::option")] - pub incremental_data_last_refresh_date_time: Option, - #[doc = "The skipped datapoint count."] - #[serde(rename = "skippedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub skipped_datapoint_count: Option, - #[doc = "The total datapoint count."] - #[serde(rename = "totalDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub total_datapoint_count: Option, -} -impl ProgressMetrics { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Protection level associated with the Intellectual Property."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ProtectionLevel")] -pub enum ProtectionLevel { - All, - None, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ProtectionLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ProtectionLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ProtectionLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::All => serializer.serialize_unit_variant("ProtectionLevel", 0u32, "All"), - Self::None => serializer.serialize_unit_variant("ProtectionLevel", 1u32, "None"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PublicNetworkAccessType")] -pub enum PublicNetworkAccessType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PublicNetworkAccessType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PublicNetworkAccessType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PublicNetworkAccessType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccessType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccessType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "PyTorch distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PyTorch { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of processes per node."] - #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] - pub process_count_per_instance: Option, -} -impl PyTorch { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - process_count_per_instance: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueueSettings { - #[doc = "Enum to determine the job tier."] - #[serde(rename = "jobTier", default, skip_serializing_if = "Option::is_none")] - pub job_tier: Option, - #[doc = "Controls the priority of the job on a compute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option, -} -impl QueueSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties for Quota update or retrieval."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QuotaBaseProperties { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The maximum permitted quota of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "An enum describing the unit of quota measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, -} -impl QuotaBaseProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod quota_base_properties { - use super::*; - #[doc = "An enum describing the unit of quota measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Quota update parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QuotaUpdateParameters { - #[doc = "The list for update quota."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Region of workspace quota to be updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, -} -impl QuotaUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines a Sampling Algorithm that generates values randomly"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RandomSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, - #[doc = "An optional positive number or e in string format to be used as base for log based random sampling"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub logbase: Option, - #[doc = "The specific type of random algorithm"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rule: Option, - #[doc = "An optional integer to use as the seed for random number generation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub seed: Option, -} -impl RandomSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { - sampling_algorithm, - logbase: None, - rule: None, - seed: None, - } - } -} -#[doc = "The specific type of random algorithm"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RandomSamplingAlgorithmRule")] -pub enum RandomSamplingAlgorithmRule { - Random, - Sobol, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RandomSamplingAlgorithmRule { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RandomSamplingAlgorithmRule { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RandomSamplingAlgorithmRule { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Random => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 0u32, "Random"), - Self::Sobol => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 1u32, "Sobol"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Ray distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Ray { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "The address of Ray head node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - #[doc = "The port to bind the dashboard server to."] - #[serde(rename = "dashboardPort", default, skip_serializing_if = "Option::is_none")] - pub dashboard_port: Option, - #[doc = "Additional arguments passed to ray start in head node."] - #[serde(rename = "headNodeAdditionalArgs", default, skip_serializing_if = "Option::is_none")] - pub head_node_additional_args: Option, - #[doc = "Provide this argument to start the Ray dashboard GUI."] - #[serde(rename = "includeDashboard", default, skip_serializing_if = "Option::is_none")] - pub include_dashboard: Option, - #[doc = "The port of the head ray process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "Additional arguments passed to ray start in worker node."] - #[serde(rename = "workerNodeAdditionalArgs", default, skip_serializing_if = "Option::is_none")] - pub worker_node_additional_args: Option, -} -impl Ray { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - address: None, - dashboard_port: None, - head_node_additional_args: None, - include_dashboard: None, - port: None, - worker_node_additional_args: None, - } - } -} -#[doc = "The workflow trigger recurrence for ComputeStartStop schedule type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Recurrence { - #[doc = "Enum to describe the frequency of a recurrence schedule"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub frequency: Option, - #[doc = "[Required] Specifies schedule interval in conjunction with frequency"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[doc = "The start time in yyyy-MM-ddTHH:mm:ss format."] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl Recurrence { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to describe the frequency of a recurrence schedule"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RecurrenceFrequency")] -pub enum RecurrenceFrequency { - Minute, - Hour, - Day, - Week, - Month, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RecurrenceFrequency { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RecurrenceFrequency { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RecurrenceFrequency { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Minute => serializer.serialize_unit_variant("RecurrenceFrequency", 0u32, "Minute"), - Self::Hour => serializer.serialize_unit_variant("RecurrenceFrequency", 1u32, "Hour"), - Self::Day => serializer.serialize_unit_variant("RecurrenceFrequency", 2u32, "Day"), - Self::Week => serializer.serialize_unit_variant("RecurrenceFrequency", 3u32, "Week"), - Self::Month => serializer.serialize_unit_variant("RecurrenceFrequency", 4u32, "Month"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RecurrenceSchedule { - #[doc = "[Required] List of hours for the schedule."] - pub hours: Vec, - #[doc = "[Required] List of minutes for the schedule."] - pub minutes: Vec, - #[doc = "List of month days for the schedule"] - #[serde( - rename = "monthDays", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub month_days: Vec, - #[doc = "List of days for the schedule."] - #[serde( - rename = "weekDays", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub week_days: Vec, -} -impl RecurrenceSchedule { - pub fn new(hours: Vec, minutes: Vec) -> Self { - Self { - hours, - minutes, - month_days: Vec::new(), - week_days: Vec::new(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RecurrenceTrigger { - #[serde(flatten)] - pub trigger_base: TriggerBase, - #[doc = "Enum to describe the frequency of a recurrence schedule"] - pub frequency: RecurrenceFrequency, - #[doc = "[Required] Specifies schedule interval in conjunction with frequency"] - pub interval: i32, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl RecurrenceTrigger { - pub fn new(trigger_base: TriggerBase, frequency: RecurrenceFrequency, interval: i32) -> Self { - Self { - trigger_base, - frequency, - interval, - schedule: None, - } - } -} -#[doc = "Enum to determine which reference method to use for an asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ReferenceType")] -pub enum ReferenceType { - Id, - DataPath, - OutputPath, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ReferenceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ReferenceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ReferenceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Id => serializer.serialize_unit_variant("ReferenceType", 0u32, "Id"), - Self::DataPath => serializer.serialize_unit_variant("ReferenceType", 1u32, "DataPath"), - Self::OutputPath => serializer.serialize_unit_variant("ReferenceType", 2u32, "OutputPath"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegenerateEndpointKeysRequest { - #[serde(rename = "keyType")] - pub key_type: KeyType, - #[doc = "The value the key is set to."] - #[serde(rename = "keyValue", default, skip_serializing_if = "Option::is_none")] - pub key_value: Option, -} -impl RegenerateEndpointKeysRequest { - pub fn new(key_type: KeyType) -> Self { - Self { key_type, key_value: None } - } -} -#[doc = "Details of the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Registry { - #[doc = "Discovery URL for the Registry"] - #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] - pub discovery_url: Option, - #[doc = "IntellectualPropertyPublisher for the registry"] - #[serde(rename = "intellectualPropertyPublisher", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property_publisher: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "managedResourceGroup", default, skip_serializing_if = "Option::is_none")] - pub managed_resource_group: Option, - #[doc = "MLFlow Registry URI for the Registry"] - #[serde(rename = "mlFlowRegistryUri", default, skip_serializing_if = "Option::is_none")] - pub ml_flow_registry_uri: Option, - #[doc = "Private endpoint connections info used for pending connections in private link portal"] - #[serde( - rename = "privateEndpointConnections", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub private_endpoint_connections: Vec, - #[doc = "Is the Registry accessible from the internet?\r\nPossible values: \"Enabled\" or \"Disabled\""] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "Details of each region the registry is in"] - #[serde( - rename = "regionDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub region_details: Vec, -} -impl Registry { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryListCredentialsResult { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub passwords: Vec, -} -impl RegistryListCredentialsResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegistryPartialManagedServiceIdentity { - #[serde(flatten)] - pub managed_service_identity: ManagedServiceIdentity, -} -impl RegistryPartialManagedServiceIdentity { - pub fn new(managed_service_identity: ManagedServiceIdentity) -> Self { - Self { managed_service_identity } - } -} -#[doc = "Private endpoint connection definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryPrivateEndpointConnection { - #[doc = "This is the private endpoint connection name created on SRP\r\nFull resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Same as workspace location."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Properties of the Private Endpoint Connection"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl RegistryPrivateEndpointConnection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of the Private Endpoint Connection"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryPrivateEndpointConnectionProperties { - #[doc = "The group ids"] - #[serde( - rename = "groupIds", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub group_ids: Vec, - #[doc = "The PE network resource that is linked to this PE connection."] - #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] - pub private_endpoint: Option, - #[doc = "The connection state."] - #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] - pub private_link_service_connection_state: Option, - #[doc = "One of null, \"Succeeded\", \"Provisioning\", \"Failed\". While not approved, it's null."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl RegistryPrivateEndpointConnectionProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The connection state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryPrivateLinkServiceConnectionState { - #[doc = "Some RP chose \"None\". Other RPs use this for region expansion."] - #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] - pub actions_required: Option, - #[doc = "User-defined message that, per NRP doc, may be used for approval-related message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Connection status of the service consumer with the service provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl RegistryPrivateLinkServiceConnectionState { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Details for each region the registry is in"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryRegionArmDetails { - #[doc = "List of ACR accounts"] - #[serde( - rename = "acrDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub acr_details: Vec, - #[doc = "The location where the registry exists"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "List of storage accounts"] - #[serde( - rename = "storageAccountDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub storage_account_details: Vec, -} -impl RegistryRegionArmDetails { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegistryTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Details of the Registry"] - pub properties: Registry, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl RegistryTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: Registry) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of Registry entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of Registry objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Registry."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for RegistryTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl RegistryTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Regression task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Regression { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for Regression task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Regression Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Regression { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - primary_metric: None, - training_settings: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionModelPerformanceMetric")] -pub enum RegressionModelPerformanceMetric { - MeanAbsoluteError, - RootMeanSquaredError, - MeanSquaredError, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RegressionModelPerformanceMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RegressionModelPerformanceMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RegressionModelPerformanceMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAbsoluteError => serializer.serialize_unit_variant("RegressionModelPerformanceMetric", 0u32, "MeanAbsoluteError"), - Self::RootMeanSquaredError => { - serializer.serialize_unit_variant("RegressionModelPerformanceMetric", 1u32, "RootMeanSquaredError") - } - Self::MeanSquaredError => serializer.serialize_unit_variant("RegressionModelPerformanceMetric", 2u32, "MeanSquaredError"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegressionModelPerformanceMetricThreshold { - #[serde(flatten)] - pub model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - pub metric: RegressionModelPerformanceMetric, -} -impl RegressionModelPerformanceMetricThreshold { - pub fn new( - model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - metric: RegressionModelPerformanceMetric, - ) -> Self { - Self { - model_performance_metric_threshold_base, - metric, - } - } -} -#[doc = "Enum for all Regression models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionModels")] -pub enum RegressionModels { - ElasticNet, - GradientBoosting, - DecisionTree, - #[serde(rename = "KNN")] - Knn, - LassoLars, - #[serde(rename = "SGD")] - Sgd, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - #[serde(rename = "XGBoostRegressor")] - XgBoostRegressor, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RegressionModels { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RegressionModels { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RegressionModels { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ElasticNet => serializer.serialize_unit_variant("RegressionModels", 0u32, "ElasticNet"), - Self::GradientBoosting => serializer.serialize_unit_variant("RegressionModels", 1u32, "GradientBoosting"), - Self::DecisionTree => serializer.serialize_unit_variant("RegressionModels", 2u32, "DecisionTree"), - Self::Knn => serializer.serialize_unit_variant("RegressionModels", 3u32, "KNN"), - Self::LassoLars => serializer.serialize_unit_variant("RegressionModels", 4u32, "LassoLars"), - Self::Sgd => serializer.serialize_unit_variant("RegressionModels", 5u32, "SGD"), - Self::RandomForest => serializer.serialize_unit_variant("RegressionModels", 6u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("RegressionModels", 7u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("RegressionModels", 8u32, "LightGBM"), - Self::XgBoostRegressor => serializer.serialize_unit_variant("RegressionModels", 9u32, "XGBoostRegressor"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for Regression task."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionPrimaryMetrics")] -pub enum RegressionPrimaryMetrics { - SpearmanCorrelation, - NormalizedRootMeanSquaredError, - R2Score, - NormalizedMeanAbsoluteError, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RegressionPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RegressionPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RegressionPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SpearmanCorrelation => serializer.serialize_unit_variant("RegressionPrimaryMetrics", 0u32, "SpearmanCorrelation"), - Self::NormalizedRootMeanSquaredError => { - serializer.serialize_unit_variant("RegressionPrimaryMetrics", 1u32, "NormalizedRootMeanSquaredError") - } - Self::R2Score => serializer.serialize_unit_variant("RegressionPrimaryMetrics", 2u32, "R2Score"), - Self::NormalizedMeanAbsoluteError => { - serializer.serialize_unit_variant("RegressionPrimaryMetrics", 3u32, "NormalizedMeanAbsoluteError") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Regression Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegressionTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for regression task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for regression task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl RegressionTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RequestLogging { - #[doc = "For payload logging, we only collect payload by default. If customers also want to collect the specified headers, they can set them in captureHeaders so that backend will collect those headers along with payload."] - #[serde( - rename = "captureHeaders", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub capture_headers: Vec, -} -impl RequestLogging { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceBase { - #[doc = "The asset description text."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The asset property dictionary."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl ResourceBase { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceConfiguration { - #[doc = "Optional number of instances or nodes used by the compute target."] - #[serde(rename = "instanceCount", default, skip_serializing_if = "Option::is_none")] - pub instance_count: Option, - #[doc = "Optional type of VM used as supported by the compute target."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Locations where the job can run."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub locations: Vec, - #[doc = "Optional max allowed number of instances or nodes to be used by the compute target.\r\nFor use with elastic training, currently supported by PyTorch distribution type only."] - #[serde(rename = "maxInstanceCount", default, skip_serializing_if = "Option::is_none")] - pub max_instance_count: Option, - #[doc = "Additional properties bag."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ResourceId { - #[doc = "The ID of the resource"] - pub id: String, -} -impl ResourceId { - pub fn new(id: String) -> Self { - Self { id } - } -} -#[doc = "The Resource Name."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceName { - #[doc = "The name of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The localized name of the resource."] - #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] - pub localized_value: Option, -} -impl ResourceName { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The quota assigned to a resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceQuota { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Region of the AML workspace in the id."] - #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] - pub aml_workspace_location: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The Resource Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The maximum permitted quota of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "An enum describing the unit of quota measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, -} -impl ResourceQuota { - pub fn new() -> Self { - Self::default() - } -} -pub mod resource_quota { - use super::*; - #[doc = "An enum describing the unit of quota measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RollingRateType")] -pub enum RollingRateType { - Year, - Month, - Day, - Hour, - Minute, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RollingRateType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RollingRateType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RollingRateType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Year => serializer.serialize_unit_variant("RollingRateType", 0u32, "Year"), - Self::Month => serializer.serialize_unit_variant("RollingRateType", 1u32, "Month"), - Self::Day => serializer.serialize_unit_variant("RollingRateType", 2u32, "Day"), - Self::Hour => serializer.serialize_unit_variant("RollingRateType", 3u32, "Hour"), - Self::Minute => serializer.serialize_unit_variant("RollingRateType", 4u32, "Minute"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Route { - #[doc = "[Required] The path for the route."] - pub path: String, - #[doc = "[Required] The port for the route."] - pub port: i32, -} -impl Route { - pub fn new(path: String, port: i32) -> Self { - Self { path, port } - } -} -#[doc = "Category of a managed network Outbound Rule of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleCategory")] -pub enum RuleCategory { - Required, - Recommended, - UserDefined, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleCategory { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleCategory { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleCategory { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Required => serializer.serialize_unit_variant("RuleCategory", 0u32, "Required"), - Self::Recommended => serializer.serialize_unit_variant("RuleCategory", 1u32, "Recommended"), - Self::UserDefined => serializer.serialize_unit_variant("RuleCategory", 2u32, "UserDefined"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Status of a managed network Outbound Rule of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleStatus")] -pub enum RuleStatus { - Inactive, - Active, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Inactive => serializer.serialize_unit_variant("RuleStatus", 0u32, "Inactive"), - Self::Active => serializer.serialize_unit_variant("RuleStatus", 1u32, "Active"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Type of a managed network Outbound Rule of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleType")] -pub enum RuleType { - #[serde(rename = "FQDN")] - Fqdn, - PrivateEndpoint, - ServiceTag, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Fqdn => serializer.serialize_unit_variant("RuleType", 0u32, "FQDN"), - Self::PrivateEndpoint => serializer.serialize_unit_variant("RuleType", 1u32, "PrivateEndpoint"), - Self::ServiceTag => serializer.serialize_unit_variant("RuleType", 2u32, "ServiceTag"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl SasAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasCredentialDto { - #[serde(flatten)] - pub pending_upload_credential_dto: PendingUploadCredentialDto, - #[doc = "Full SAS Uri, including the storage, container/blob path and SAS token"] - #[serde(rename = "sasUri", default, skip_serializing_if = "Option::is_none")] - pub sas_uri: Option, -} -impl SasCredentialDto { - pub fn new(pending_upload_credential_dto: PendingUploadCredentialDto) -> Self { - Self { - pending_upload_credential_dto, - sas_uri: None, - } - } -} -#[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamplingAlgorithm { - #[serde(rename = "samplingAlgorithmType")] - pub sampling_algorithm_type: SamplingAlgorithmType, -} -impl SamplingAlgorithm { - pub fn new(sampling_algorithm_type: SamplingAlgorithmType) -> Self { - Self { sampling_algorithm_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "samplingAlgorithmType")] -pub enum SamplingAlgorithmUnion { - Bayesian(BayesianSamplingAlgorithm), - Grid(GridSamplingAlgorithm), - Random(RandomSamplingAlgorithm), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SamplingAlgorithmType")] -pub enum SamplingAlgorithmType { - Grid, - Random, - Bayesian, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SamplingAlgorithmType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SamplingAlgorithmType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SamplingAlgorithmType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Grid => serializer.serialize_unit_variant("SamplingAlgorithmType", 0u32, "Grid"), - Self::Random => serializer.serialize_unit_variant("SamplingAlgorithmType", 1u32, "Random"), - Self::Bayesian => serializer.serialize_unit_variant("SamplingAlgorithmType", 2u32, "Bayesian"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "SAS datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Datastore SAS secrets."] - pub secrets: SasDatastoreSecrets, -} -impl SasDatastoreCredentials { - pub fn new(datastore_credentials: DatastoreCredentials, secrets: SasDatastoreSecrets) -> Self { - Self { - datastore_credentials, - secrets, - } - } -} -#[doc = "Datastore SAS secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Storage container SAS token."] - #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] - pub sas_token: Option, -} -impl SasDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - sas_token: None, - } - } -} -#[doc = "scale settings for AML Compute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScaleSettings { - #[doc = "Max number of nodes to use"] - #[serde(rename = "maxNodeCount")] - pub max_node_count: i32, - #[doc = "Min number of nodes to use"] - #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] - pub min_node_count: Option, - #[doc = "Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format."] - #[serde(rename = "nodeIdleTimeBeforeScaleDown", default, skip_serializing_if = "Option::is_none")] - pub node_idle_time_before_scale_down: Option, -} -impl ScaleSettings { - pub fn new(max_node_count: i32) -> Self { - Self { - max_node_count, - min_node_count: None, - node_idle_time_before_scale_down: None, - } - } -} -#[doc = "Desired scale settings for the amlCompute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScaleSettingsInformation { - #[doc = "scale settings for AML Compute"] - #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, -} -impl ScaleSettingsInformation { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScaleType")] -pub enum ScaleType { - Default, - TargetUtilization, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScaleType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScaleType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScaleType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("ScaleType", 0u32, "Default"), - Self::TargetUtilization => serializer.serialize_unit_variant("ScaleType", 1u32, "TargetUtilization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition of a schedule"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Schedule { - #[serde(flatten)] - pub resource_base: ResourceBase, - pub action: ScheduleActionBaseUnion, - #[doc = "Display name of schedule."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Is the schedule enabled?"] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option, - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - pub trigger: TriggerBaseUnion, -} -impl Schedule { - pub fn new(action: ScheduleActionBaseUnion, trigger: TriggerBaseUnion) -> Self { - Self { - resource_base: ResourceBase::default(), - action, - display_name: None, - is_enabled: None, - provisioning_state: None, - trigger, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduleActionBase { - #[serde(rename = "actionType")] - pub action_type: ScheduleActionType, -} -impl ScheduleActionBase { - pub fn new(action_type: ScheduleActionType) -> Self { - Self { action_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "actionType")] -pub enum ScheduleActionBaseUnion { - CreateMonitor(CreateMonitorAction), - InvokeBatchEndpoint(EndpointScheduleAction), - ImportData(ImportDataAction), - CreateJob(JobScheduleAction), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleActionType")] -pub enum ScheduleActionType { - CreateJob, - InvokeBatchEndpoint, - ImportData, - CreateMonitor, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleActionType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleActionType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleActionType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreateJob => serializer.serialize_unit_variant("ScheduleActionType", 0u32, "CreateJob"), - Self::InvokeBatchEndpoint => serializer.serialize_unit_variant("ScheduleActionType", 1u32, "InvokeBatchEndpoint"), - Self::ImportData => serializer.serialize_unit_variant("ScheduleActionType", 2u32, "ImportData"), - Self::CreateMonitor => serializer.serialize_unit_variant("ScheduleActionType", 3u32, "CreateMonitor"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScheduleBase { - #[doc = "A system assigned id for the schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The current deployment state of schedule."] - #[serde(rename = "provisioningStatus", default, skip_serializing_if = "Option::is_none")] - pub provisioning_status: Option, - #[doc = "Is the schedule enabled or disabled?"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl ScheduleBase { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleListViewType")] -pub enum ScheduleListViewType { - EnabledOnly, - DisabledOnly, - All, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleListViewType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleListViewType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleListViewType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::EnabledOnly => serializer.serialize_unit_variant("ScheduleListViewType", 0u32, "EnabledOnly"), - Self::DisabledOnly => serializer.serialize_unit_variant("ScheduleListViewType", 1u32, "DisabledOnly"), - Self::All => serializer.serialize_unit_variant("ScheduleListViewType", 2u32, "All"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The current deployment state of schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleProvisioningState")] -pub enum ScheduleProvisioningState { - Completed, - Provisioning, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Completed => serializer.serialize_unit_variant("ScheduleProvisioningState", 0u32, "Completed"), - Self::Provisioning => serializer.serialize_unit_variant("ScheduleProvisioningState", 1u32, "Provisioning"), - Self::Failed => serializer.serialize_unit_variant("ScheduleProvisioningState", 2u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleProvisioningStatus")] -pub enum ScheduleProvisioningStatus { - Creating, - Updating, - Deleting, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleProvisioningStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleProvisioningStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleProvisioningStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 0u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 1u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 2u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 3u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 4u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 5u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduleResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Base definition of a schedule"] - pub properties: Schedule, -} -impl ScheduleResource { - pub fn new(properties: Schedule) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of Schedule entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScheduleResourceArmPaginatedResult { - #[doc = "The link to the next page of Schedule objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Schedule."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ScheduleResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ScheduleResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Is the schedule enabled or disabled?"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleStatus")] -pub enum ScheduleStatus { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("ScheduleStatus", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("ScheduleStatus", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Script reference"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScriptReference { - #[doc = "The storage source of the script: inline, workspace."] - #[serde(rename = "scriptSource", default, skip_serializing_if = "Option::is_none")] - pub script_source: Option, - #[doc = "The location of scripts in the mounted volume."] - #[serde(rename = "scriptData", default, skip_serializing_if = "Option::is_none")] - pub script_data: Option, - #[doc = "Optional command line arguments passed to the script to run."] - #[serde(rename = "scriptArguments", default, skip_serializing_if = "Option::is_none")] - pub script_arguments: Option, - #[doc = "Optional time period passed to timeout command."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl ScriptReference { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Customized setup scripts"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScriptsToExecute { - #[doc = "Script reference"] - #[serde(rename = "startupScript", default, skip_serializing_if = "Option::is_none")] - pub startup_script: Option, - #[doc = "Script reference"] - #[serde(rename = "creationScript", default, skip_serializing_if = "Option::is_none")] - pub creation_script: Option, -} -impl ScriptsToExecute { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecasting seasonality."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Seasonality { - #[doc = "Forecasting seasonality mode."] - pub mode: SeasonalityMode, -} -impl Seasonality { - pub fn new(mode: SeasonalityMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum SeasonalityUnion { - Auto(AutoSeasonality), - Custom(CustomSeasonality), -} -#[doc = "Forecasting seasonality mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SeasonalityMode")] -pub enum SeasonalityMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SeasonalityMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SeasonalityMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SeasonalityMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("SeasonalityMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("SeasonalityMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Secret Configuration definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecretConfiguration { - #[doc = "Secret Uri.\r\nSample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, - #[doc = "Name of secret in workspace key vault."] - #[serde(rename = "workspaceSecretName", default, skip_serializing_if = "Option::is_none")] - pub workspace_secret_name: Option, -} -impl SecretConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to determine the datastore secrets type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SecretsType")] -pub enum SecretsType { - AccountKey, - Certificate, - Sas, - ServicePrincipal, - KerberosPassword, - KerberosKeytab, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SecretsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SecretsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SecretsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AccountKey => serializer.serialize_unit_variant("SecretsType", 0u32, "AccountKey"), - Self::Certificate => serializer.serialize_unit_variant("SecretsType", 1u32, "Certificate"), - Self::Sas => serializer.serialize_unit_variant("SecretsType", 2u32, "Sas"), - Self::ServicePrincipal => serializer.serialize_unit_variant("SecretsType", 3u32, "ServicePrincipal"), - Self::KerberosPassword => serializer.serialize_unit_variant("SecretsType", 4u32, "KerberosPassword"), - Self::KerberosKeytab => serializer.serialize_unit_variant("SecretsType", 5u32, "KerberosKeytab"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ServiceDataAccessAuthIdentity")] -pub enum ServiceDataAccessAuthIdentity { - None, - WorkspaceSystemAssignedIdentity, - WorkspaceUserAssignedIdentity, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ServiceDataAccessAuthIdentity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ServiceDataAccessAuthIdentity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ServiceDataAccessAuthIdentity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ServiceDataAccessAuthIdentity", 0u32, "None"), - Self::WorkspaceSystemAssignedIdentity => { - serializer.serialize_unit_variant("ServiceDataAccessAuthIdentity", 1u32, "WorkspaceSystemAssignedIdentity") - } - Self::WorkspaceUserAssignedIdentity => { - serializer.serialize_unit_variant("ServiceDataAccessAuthIdentity", 2u32, "WorkspaceUserAssignedIdentity") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServiceManagedResourcesSettings { - #[serde(rename = "cosmosDb", default, skip_serializing_if = "Option::is_none")] - pub cosmos_db: Option, -} -impl ServiceManagedResourcesSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ServicePrincipalAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Service Principal datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Authority URL used for authentication."] - #[serde(rename = "authorityUrl", default, skip_serializing_if = "Option::is_none")] - pub authority_url: Option, - #[doc = "[Required] Service principal client ID."] - #[serde(rename = "clientId")] - pub client_id: String, - #[doc = "Resource the service principal has access to."] - #[serde(rename = "resourceUrl", default, skip_serializing_if = "Option::is_none")] - pub resource_url: Option, - #[doc = "Datastore Service Principal secrets."] - pub secrets: ServicePrincipalDatastoreSecrets, - #[doc = "[Required] ID of the tenant to which the service principal belongs."] - #[serde(rename = "tenantId")] - pub tenant_id: String, -} -impl ServicePrincipalDatastoreCredentials { - pub fn new( - datastore_credentials: DatastoreCredentials, - client_id: String, - secrets: ServicePrincipalDatastoreSecrets, - tenant_id: String, - ) -> Self { - Self { - datastore_credentials, - authority_url: None, - client_id, - resource_url: None, - secrets, - tenant_id, - } - } -} -#[doc = "Datastore Service Principal secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Service principal secret."] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, -} -impl ServicePrincipalDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - client_secret: None, - } - } -} -#[doc = "Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServiceTagDestination { - #[serde(rename = "serviceTag", default, skip_serializing_if = "Option::is_none")] - pub service_tag: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "portRanges", default, skip_serializing_if = "Option::is_none")] - pub port_ranges: Option, -} -impl ServiceTagDestination { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Service Tag Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceTagOutboundRule { - #[serde(flatten)] - pub outbound_rule: OutboundRule, - #[doc = "Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, -} -impl ServiceTagOutboundRule { - pub fn new(outbound_rule: OutboundRule) -> Self { - Self { - outbound_rule, - destination: None, - } - } -} -#[doc = "Details of customized scripts to execute for setting up the cluster."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SetupScripts { - #[doc = "Customized setup scripts"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scripts: Option, -} -impl SetupScripts { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SharedPrivateLinkResource { - #[doc = "Unique name of the private link."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Properties of a shared private link resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SharedPrivateLinkResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a shared private link resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SharedPrivateLinkResourceProperty { - #[doc = "The resource id that private link links to."] - #[serde(rename = "privateLinkResourceId", default, skip_serializing_if = "Option::is_none")] - pub private_link_resource_id: Option, - #[doc = "The private link resource group id."] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option, - #[doc = "Request message."] - #[serde(rename = "requestMessage", default, skip_serializing_if = "Option::is_none")] - pub request_message: Option, - #[doc = "The private endpoint connection status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl SharedPrivateLinkResourceProperty { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The parameter defining how if AutoML should handle short time series."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ShortSeriesHandlingConfiguration")] -pub enum ShortSeriesHandlingConfiguration { - None, - Auto, - Pad, - Drop, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ShortSeriesHandlingConfiguration { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ShortSeriesHandlingConfiguration { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ShortSeriesHandlingConfiguration { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 0u32, "None"), - Self::Auto => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 1u32, "Auto"), - Self::Pad => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 2u32, "Pad"), - Self::Drop => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 3u32, "Drop"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The resource model definition representing SKU"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Sku { - #[doc = "The name of the SKU. Ex - P3. It is typically a letter+number code"] - pub name: String, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, - #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. "] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, - #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, -} -impl Sku { - pub fn new(name: String) -> Self { - Self { - name, - tier: None, - size: None, - family: None, - capacity: None, - } - } -} -#[doc = "SKU capacity information"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SkuCapacity { - #[doc = "Gets or sets the default capacity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub default: Option, - #[doc = "Gets or sets the maximum."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub maximum: Option, - #[doc = "Gets or sets the minimum."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub minimum: Option, - #[doc = "Node scaling setting for the compute sku."] - #[serde(rename = "scaleType", default, skip_serializing_if = "Option::is_none")] - pub scale_type: Option, -} -impl SkuCapacity { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Fulfills ARM Contract requirement to list all available SKUS for a resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SkuResource { - #[doc = "SKU capacity information"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, - #[doc = "The resource type name."] - #[serde(rename = "resourceType", default, skip_serializing_if = "Option::is_none")] - pub resource_type: Option, - #[doc = "SkuSetting fulfills the need for stripped down SKU info in ARM contract."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl SkuResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A paginated list of SkuResource entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SkuResourceArmPaginatedResult { - #[doc = "The link to the next page of SkuResource objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type SkuResource."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for SkuResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl SkuResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Node scaling setting for the compute sku."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SkuScaleType")] -pub enum SkuScaleType { - Automatic, - Manual, - None, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SkuScaleType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SkuScaleType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SkuScaleType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Automatic => serializer.serialize_unit_variant("SkuScaleType", 0u32, "Automatic"), - Self::Manual => serializer.serialize_unit_variant("SkuScaleType", 1u32, "Manual"), - Self::None => serializer.serialize_unit_variant("SkuScaleType", 2u32, "None"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "SkuSetting fulfills the need for stripped down SKU info in ARM contract."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SkuSetting { - #[doc = "[Required] The name of the SKU. Ex - P3. It is typically a letter+number code."] - pub name: String, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, -} -impl SkuSetting { - pub fn new(name: String) -> Self { - Self { name, tier: None } - } -} -#[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum SkuTier { - Free, - Basic, - Standard, - Premium, -} -#[doc = "Spark job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Archive files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub archives: Vec, - #[doc = "Arguments for the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub args: Option, - #[doc = "[Required] ARM resource ID of the code asset."] - #[serde(rename = "codeId")] - pub code_id: String, - #[doc = "Spark configured properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub conf: Option, - #[doc = "Spark job entry point definition."] - pub entry: SparkJobEntryUnion, - #[doc = "The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub files: Vec, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jar files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub jars: Vec, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Python files used in the job."] - #[serde( - rename = "pyFiles", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub py_files: Vec, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl SparkJob { - pub fn new(job_base: JobBase, code_id: String, entry: SparkJobEntryUnion) -> Self { - Self { - job_base, - archives: Vec::new(), - args: None, - code_id, - conf: None, - entry, - environment_id: None, - files: Vec::new(), - inputs: None, - jars: Vec::new(), - outputs: None, - py_files: Vec::new(), - queue_settings: None, - resources: None, - } - } -} -#[doc = "Spark job entry point definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobEntry { - #[serde(rename = "sparkJobEntryType")] - pub spark_job_entry_type: SparkJobEntryType, -} -impl SparkJobEntry { - pub fn new(spark_job_entry_type: SparkJobEntryType) -> Self { - Self { spark_job_entry_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "sparkJobEntryType")] -pub enum SparkJobEntryUnion { - SparkJobPythonEntry(SparkJobPythonEntry), - SparkJobScalaEntry(SparkJobScalaEntry), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SparkJobEntryType")] -pub enum SparkJobEntryType { - SparkJobPythonEntry, - SparkJobScalaEntry, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SparkJobEntryType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SparkJobEntryType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SparkJobEntryType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SparkJobPythonEntry => serializer.serialize_unit_variant("SparkJobEntryType", 0u32, "SparkJobPythonEntry"), - Self::SparkJobScalaEntry => serializer.serialize_unit_variant("SparkJobEntryType", 1u32, "SparkJobScalaEntry"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobPythonEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Relative python file path for job entry point."] - pub file: String, -} -impl SparkJobPythonEntry { - pub fn new(spark_job_entry: SparkJobEntry, file: String) -> Self { - Self { spark_job_entry, file } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobScalaEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Scala class name used as entry point."] - #[serde(rename = "className")] - pub class_name: String, -} -impl SparkJobScalaEntry { - pub fn new(spark_job_entry: SparkJobEntry, class_name: String) -> Self { - Self { - spark_job_entry, - class_name, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SparkResourceConfiguration { - #[doc = "Optional type of VM used as supported by the compute target."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Version of spark runtime used for the job."] - #[serde(rename = "runtimeVersion", default, skip_serializing_if = "Option::is_none")] - pub runtime_version: Option, -} -impl SparkResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The ssl configuration for scoring"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SslConfiguration { - #[doc = "Enable or disable ssl for scoring"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Cert data"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cert: Option, - #[doc = "Key data"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option, - #[doc = "CNAME of the cert"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cname: Option, - #[doc = "Leaf domain label of public endpoint"] - #[serde(rename = "leafDomainLabel", default, skip_serializing_if = "Option::is_none")] - pub leaf_domain_label: Option, - #[doc = "Indicates whether to overwrite existing domain label."] - #[serde(rename = "overwriteExistingDomain", default, skip_serializing_if = "Option::is_none")] - pub overwrite_existing_domain: Option, -} -impl SslConfiguration { - pub fn new() -> Self { - Self::default() - } -} -pub mod ssl_configuration { - use super::*; - #[doc = "Enable or disable ssl for scoring"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Disabled, - Enabled, - Auto, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("Status", 0u32, "Disabled"), - Self::Enabled => serializer.serialize_unit_variant("Status", 1u32, "Enabled"), - Self::Auto => serializer.serialize_unit_variant("Status", 2u32, "Auto"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Advances setting to customize StackEnsemble run."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StackEnsembleSettings { - #[doc = "Optional parameters to pass to the initializer of the meta-learner."] - #[serde(rename = "stackMetaLearnerKWargs", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_k_wargs: Option, - #[doc = "Specifies the proportion of the training set (when choosing train and validation type of training) to be reserved for training the meta-learner. Default value is 0.2."] - #[serde(rename = "stackMetaLearnerTrainPercentage", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_train_percentage: Option, - #[doc = "The meta-learner is a model trained on the output of the individual heterogeneous models.\r\nDefault meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled).\r\nThis parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression"] - #[serde(rename = "stackMetaLearnerType", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_type: Option, -} -impl StackEnsembleSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The meta-learner is a model trained on the output of the individual heterogeneous models.\r\nDefault meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled).\r\nThis parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StackMetaLearnerType")] -pub enum StackMetaLearnerType { - None, - LogisticRegression, - #[serde(rename = "LogisticRegressionCV")] - LogisticRegressionCv, - #[serde(rename = "LightGBMClassifier")] - LightGbmClassifier, - ElasticNet, - #[serde(rename = "ElasticNetCV")] - ElasticNetCv, - #[serde(rename = "LightGBMRegressor")] - LightGbmRegressor, - LinearRegression, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StackMetaLearnerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StackMetaLearnerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StackMetaLearnerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("StackMetaLearnerType", 0u32, "None"), - Self::LogisticRegression => serializer.serialize_unit_variant("StackMetaLearnerType", 1u32, "LogisticRegression"), - Self::LogisticRegressionCv => serializer.serialize_unit_variant("StackMetaLearnerType", 2u32, "LogisticRegressionCV"), - Self::LightGbmClassifier => serializer.serialize_unit_variant("StackMetaLearnerType", 3u32, "LightGBMClassifier"), - Self::ElasticNet => serializer.serialize_unit_variant("StackMetaLearnerType", 4u32, "ElasticNet"), - Self::ElasticNetCv => serializer.serialize_unit_variant("StackMetaLearnerType", 5u32, "ElasticNetCV"), - Self::LightGbmRegressor => serializer.serialize_unit_variant("StackMetaLearnerType", 6u32, "LightGBMRegressor"), - Self::LinearRegression => serializer.serialize_unit_variant("StackMetaLearnerType", 7u32, "LinearRegression"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Active message associated with project"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StatusMessage { - #[doc = "Service-defined message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Time in UTC at which the message was created."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "A human-readable representation of the message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl StatusMessage { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StatusMessageLevel")] -pub enum StatusMessageLevel { - Error, - Information, - Warning, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StatusMessageLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StatusMessageLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StatusMessageLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Error => serializer.serialize_unit_variant("StatusMessageLevel", 0u32, "Error"), - Self::Information => serializer.serialize_unit_variant("StatusMessageLevel", 1u32, "Information"), - Self::Warning => serializer.serialize_unit_variant("StatusMessageLevel", 2u32, "Warning"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stochastic optimizer for image models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StochasticOptimizer")] -pub enum StochasticOptimizer { - None, - Sgd, - Adam, - Adamw, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StochasticOptimizer { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StochasticOptimizer { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StochasticOptimizer { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("StochasticOptimizer", 0u32, "None"), - Self::Sgd => serializer.serialize_unit_variant("StochasticOptimizer", 1u32, "Sgd"), - Self::Adam => serializer.serialize_unit_variant("StochasticOptimizer", 2u32, "Adam"), - Self::Adamw => serializer.serialize_unit_variant("StochasticOptimizer", 3u32, "Adamw"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Details of storage account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StorageAccountDetails { - #[serde(rename = "systemCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_storage_account: Option, - #[serde(rename = "userCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_storage_account: Option, -} -impl StorageAccountDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Sweep job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SweepJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Sweep Job limit class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, - #[doc = "Optimization objective."] - pub objective: Objective, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmUnion, - #[doc = "[Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter"] - #[serde(rename = "searchSpace")] - pub search_space: serde_json::Value, - #[doc = "Trial component definition."] - pub trial: TrialComponent, -} -impl SweepJob { - pub fn new( - job_base: JobBase, - objective: Objective, - sampling_algorithm: SamplingAlgorithmUnion, - search_space: serde_json::Value, - trial: TrialComponent, - ) -> Self { - Self { - job_base, - early_termination: None, - inputs: None, - limits: None, - objective, - outputs: None, - queue_settings: None, - sampling_algorithm, - search_space, - trial, - } - } -} -#[doc = "Sweep Job limit class."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SweepJobLimits { - #[serde(flatten)] - pub job_limits: JobLimits, - #[doc = "Sweep Job max concurrent trials."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Sweep Job max total trials."] - #[serde(rename = "maxTotalTrials", default, skip_serializing_if = "Option::is_none")] - pub max_total_trials: Option, - #[doc = "Sweep Job Trial timeout value."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl SweepJobLimits { - pub fn new(job_limits: JobLimits) -> Self { - Self { - job_limits, - max_concurrent_trials: None, - max_total_trials: None, - trial_timeout: None, - } - } -} -#[doc = "A SynapseSpark compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SynapseSpark { - #[serde(flatten)] - pub compute: Compute, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SynapseSpark { - pub fn new(compute: Compute) -> Self { - Self { compute, properties: None } - } -} -pub mod synapse_spark { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Auto scale properties"] - #[serde(rename = "autoScaleProperties", default, skip_serializing_if = "Option::is_none")] - pub auto_scale_properties: Option, - #[doc = "Auto pause properties"] - #[serde(rename = "autoPauseProperties", default, skip_serializing_if = "Option::is_none")] - pub auto_pause_properties: Option, - #[doc = "Spark version."] - #[serde(rename = "sparkVersion", default, skip_serializing_if = "Option::is_none")] - pub spark_version: Option, - #[doc = "The number of compute nodes currently assigned to the compute."] - #[serde(rename = "nodeCount", default, skip_serializing_if = "Option::is_none")] - pub node_count: Option, - #[doc = "Node size."] - #[serde(rename = "nodeSize", default, skip_serializing_if = "Option::is_none")] - pub node_size: Option, - #[doc = "Node size family."] - #[serde(rename = "nodeSizeFamily", default, skip_serializing_if = "Option::is_none")] - pub node_size_family: Option, - #[doc = "Azure subscription identifier."] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, - #[doc = "Name of the resource group in which workspace is located."] - #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] - pub resource_group: Option, - #[doc = "Name of Azure Machine Learning workspace."] - #[serde(rename = "workspaceName", default, skip_serializing_if = "Option::is_none")] - pub workspace_name: Option, - #[doc = "Pool name."] - #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] - pub pool_name: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedAcrAccount { - #[doc = "Name of the ACR account"] - #[serde(rename = "acrAccountName", default, skip_serializing_if = "Option::is_none")] - pub acr_account_name: Option, - #[doc = "SKU of the ACR account"] - #[serde(rename = "acrAccountSku", default, skip_serializing_if = "Option::is_none")] - pub acr_account_sku: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl SystemCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedStorageAccount { - #[doc = "Public blob access allowed"] - #[serde(rename = "allowBlobPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub allow_blob_public_access: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, - #[doc = "HNS enabled for storage account"] - #[serde(rename = "storageAccountHnsEnabled", default, skip_serializing_if = "Option::is_none")] - pub storage_account_hns_enabled: Option, - #[doc = "Name of the storage account"] - #[serde(rename = "storageAccountName", default, skip_serializing_if = "Option::is_none")] - pub storage_account_name: Option, - #[doc = "Allowed values:\r\n\"Standard_LRS\",\r\n\"Standard_GRS\",\r\n\"Standard_RAGRS\",\r\n\"Standard_ZRS\",\r\n\"Standard_GZRS\",\r\n\"Standard_RAGZRS\",\r\n\"Premium_LRS\",\r\n\"Premium_ZRS\""] - #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] - pub storage_account_type: Option, -} -impl SystemCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A system service running on a compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemService { - #[doc = "The type of this system service."] - #[serde(rename = "systemServiceType", default, skip_serializing_if = "Option::is_none")] - pub system_service_type: Option, - #[doc = "Public IP address"] - #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] - pub public_ip_address: Option, - #[doc = "The version for this type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, -} -impl SystemService { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableFixedParameters { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample."] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableParameterSubspace { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample"] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TableSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl TableSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVertical { - #[doc = "Columns to use for CVSplit data."] - #[serde( - rename = "cvSplitColumnNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub cv_split_column_names: Vec, - #[doc = "Featurization Configuration."] - #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] - pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, - #[doc = "Job execution constraints."] - #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] - pub limit_settings: Option, - #[doc = "N-Cross validations value."] - #[serde(rename = "nCrossValidations", default, skip_serializing_if = "Option::is_none")] - pub n_cross_validations: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "testData", default, skip_serializing_if = "Option::is_none")] - pub test_data: Option, - #[doc = "The fraction of test dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "testDataSize", default, skip_serializing_if = "Option::is_none")] - pub test_data_size: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, - #[doc = "The fraction of training dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "validationDataSize", default, skip_serializing_if = "Option::is_none")] - pub validation_data_size: Option, - #[doc = "The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down."] - #[serde(rename = "weightColumnName", default, skip_serializing_if = "Option::is_none")] - pub weight_column_name: Option, -} -impl TableVertical { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Featurization Configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVerticalFeaturizationSettings { - #[serde(flatten)] - pub featurization_settings: FeaturizationSettings, - #[doc = "These transformers shall not be used in featurization."] - #[serde( - rename = "blockedTransformers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_transformers: Vec, - #[doc = "Dictionary of column name and its type (int, float, string, datetime etc)."] - #[serde(rename = "columnNameAndTypes", default, skip_serializing_if = "Option::is_none")] - pub column_name_and_types: Option, - #[doc = "Determines whether to use Dnn based featurizers for data featurization."] - #[serde(rename = "enableDnnFeaturization", default, skip_serializing_if = "Option::is_none")] - pub enable_dnn_featurization: Option, - #[doc = "Featurization mode - determines data featurization mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "User can specify additional transformers to be used along with the columns to which it would be applied and parameters for the transformer constructor."] - #[serde(rename = "transformerParams", default, skip_serializing_if = "Option::is_none")] - pub transformer_params: Option, -} -impl TableVerticalFeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Job execution constraints."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVerticalLimitSettings { - #[doc = "Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations."] - #[serde(rename = "enableEarlyTermination", default, skip_serializing_if = "Option::is_none")] - pub enable_early_termination: Option, - #[doc = "Exit score for the AutoML job."] - #[serde(rename = "exitScore", default, skip_serializing_if = "Option::is_none")] - pub exit_score: Option, - #[doc = "Maximum Concurrent iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Max cores per iteration."] - #[serde(rename = "maxCoresPerTrial", default, skip_serializing_if = "Option::is_none")] - pub max_cores_per_trial: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, - #[doc = "Number of iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "Number of concurrent sweeping runs that user wants to trigger."] - #[serde(rename = "sweepConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_concurrent_trials: Option, - #[doc = "Number of sweeping runs that user wants to trigger."] - #[serde(rename = "sweepTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[doc = "Iteration timeout."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl TableVerticalLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Target aggregate function."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetAggregationFunction")] -pub enum TargetAggregationFunction { - None, - Sum, - Max, - Min, - Mean, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetAggregationFunction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetAggregationFunction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetAggregationFunction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("TargetAggregationFunction", 0u32, "None"), - Self::Sum => serializer.serialize_unit_variant("TargetAggregationFunction", 1u32, "Sum"), - Self::Max => serializer.serialize_unit_variant("TargetAggregationFunction", 2u32, "Max"), - Self::Min => serializer.serialize_unit_variant("TargetAggregationFunction", 3u32, "Min"), - Self::Mean => serializer.serialize_unit_variant("TargetAggregationFunction", 4u32, "Mean"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The number of past periods to lag from the target column."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetLags { - #[doc = "Target lags selection modes."] - pub mode: TargetLagsMode, -} -impl TargetLags { - pub fn new(mode: TargetLagsMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum TargetLagsUnion { - Auto(AutoTargetLags), - Custom(CustomTargetLags), -} -#[doc = "Target lags selection modes."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetLagsMode")] -pub enum TargetLagsMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetLagsMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetLagsMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetLagsMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TargetLagsMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("TargetLagsMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Forecasting target rolling window size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetRollingWindowSize { - #[doc = "Target rolling windows size mode."] - pub mode: TargetRollingWindowSizeMode, -} -impl TargetRollingWindowSize { - pub fn new(mode: TargetRollingWindowSizeMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum TargetRollingWindowSizeUnion { - Auto(AutoTargetRollingWindowSize), - Custom(CustomTargetRollingWindowSize), -} -#[doc = "Target rolling windows size mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetRollingWindowSizeMode")] -pub enum TargetRollingWindowSizeMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetRollingWindowSizeMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetRollingWindowSizeMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetRollingWindowSizeMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TargetRollingWindowSizeMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("TargetRollingWindowSizeMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetUtilizationScaleSettings { - #[serde(flatten)] - pub online_scale_settings: OnlineScaleSettings, - #[doc = "The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances."] - #[serde(rename = "maxInstances", default, skip_serializing_if = "Option::is_none")] - pub max_instances: Option, - #[doc = "The minimum number of instances to always be present."] - #[serde(rename = "minInstances", default, skip_serializing_if = "Option::is_none")] - pub min_instances: Option, - #[doc = "The polling interval in ISO 8691 format. Only supports duration with precision as low as Seconds."] - #[serde(rename = "pollingInterval", default, skip_serializing_if = "Option::is_none")] - pub polling_interval: Option, - #[doc = "Target CPU usage for the autoscaler."] - #[serde(rename = "targetUtilizationPercentage", default, skip_serializing_if = "Option::is_none")] - pub target_utilization_percentage: Option, -} -impl TargetUtilizationScaleSettings { - pub fn new(online_scale_settings: OnlineScaleSettings) -> Self { - Self { - online_scale_settings, - max_instances: None, - min_instances: None, - polling_interval: None, - target_utilization_percentage: None, - } - } -} -#[doc = "AutoMLJob Task type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TaskType")] -pub enum TaskType { - Classification, - Regression, - Forecasting, - ImageClassification, - ImageClassificationMultilabel, - ImageObjectDetection, - ImageInstanceSegmentation, - TextClassification, - TextClassificationMultilabel, - #[serde(rename = "TextNER")] - TextNer, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TaskType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TaskType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TaskType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TaskType", 0u32, "Classification"), - Self::Regression => serializer.serialize_unit_variant("TaskType", 1u32, "Regression"), - Self::Forecasting => serializer.serialize_unit_variant("TaskType", 2u32, "Forecasting"), - Self::ImageClassification => serializer.serialize_unit_variant("TaskType", 3u32, "ImageClassification"), - Self::ImageClassificationMultilabel => serializer.serialize_unit_variant("TaskType", 4u32, "ImageClassificationMultilabel"), - Self::ImageObjectDetection => serializer.serialize_unit_variant("TaskType", 5u32, "ImageObjectDetection"), - Self::ImageInstanceSegmentation => serializer.serialize_unit_variant("TaskType", 6u32, "ImageInstanceSegmentation"), - Self::TextClassification => serializer.serialize_unit_variant("TaskType", 7u32, "TextClassification"), - Self::TextClassificationMultilabel => serializer.serialize_unit_variant("TaskType", 8u32, "TextClassificationMultilabel"), - Self::TextNer => serializer.serialize_unit_variant("TaskType", 9u32, "TextNER"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "TensorFlow distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TensorFlow { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of parameter server tasks."] - #[serde(rename = "parameterServerCount", default, skip_serializing_if = "Option::is_none")] - pub parameter_server_count: Option, - #[doc = "Number of workers. If not specified, will default to the instance count."] - #[serde(rename = "workerCount", default, skip_serializing_if = "Option::is_none")] - pub worker_count: Option, -} -impl TensorFlow { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - parameter_server_count: None, - worker_count: None, - } - } -} -#[doc = "Annotation type of text data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TextAnnotationType")] -pub enum TextAnnotationType { - Classification, - NamedEntityRecognition, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TextAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TextAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TextAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TextAnnotationType", 0u32, "Classification"), - Self::NamedEntityRecognition => serializer.serialize_unit_variant("TextAnnotationType", 1u32, "NamedEntityRecognition"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Text Classification task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextClassification { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextClassification { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Text Classification Multilabel task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextClassificationMultilabel { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification multilabel tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextClassificationMultilabel { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Text-NER task in AutoML NLP vertical.\r\nNER - Named Entity Recognition.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextNer { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextNer { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TmpfsOptions { - #[doc = "Mention the Tmpfs size"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, -} -impl TmpfsOptions { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TopNFeaturesByAttribution { - #[serde(flatten)] - pub monitoring_feature_filter_base: MonitoringFeatureFilterBase, - #[doc = "The number of top features to include."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub top: Option, -} -impl TopNFeaturesByAttribution { - pub fn new(monitoring_feature_filter_base: MonitoringFeatureFilterBase) -> Self { - Self { - monitoring_feature_filter_base, - top: None, - } - } -} -#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrackedResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The geo-location where the resource lives"] - pub location: String, -} -impl TrackedResource { - pub fn new(location: String) -> Self { - Self { - resource: Resource::default(), - tags: None, - location, - } - } -} -#[doc = "Training mode dictates whether to use distributed training or not"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TrainingMode")] -pub enum TrainingMode { - Auto, - Distributed, - NonDistributed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TrainingMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TrainingMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TrainingMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TrainingMode", 0u32, "Auto"), - Self::Distributed => serializer.serialize_unit_variant("TrainingMode", 1u32, "Distributed"), - Self::NonDistributed => serializer.serialize_unit_variant("TrainingMode", 2u32, "NonDistributed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TrainingSettings { - #[doc = "Enable recommendation of DNN models."] - #[serde(rename = "enableDnnTraining", default, skip_serializing_if = "Option::is_none")] - pub enable_dnn_training: Option, - #[doc = "Flag to turn on explainability on best model."] - #[serde(rename = "enableModelExplainability", default, skip_serializing_if = "Option::is_none")] - pub enable_model_explainability: Option, - #[doc = "Flag for enabling onnx compatible models."] - #[serde(rename = "enableOnnxCompatibleModels", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_compatible_models: Option, - #[doc = "Enable stack ensemble run."] - #[serde(rename = "enableStackEnsemble", default, skip_serializing_if = "Option::is_none")] - pub enable_stack_ensemble: Option, - #[doc = "Enable voting ensemble run."] - #[serde(rename = "enableVoteEnsemble", default, skip_serializing_if = "Option::is_none")] - pub enable_vote_ensemble: Option, - #[doc = "During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded.\r\nConfigure this parameter with a higher value than 300 secs, if more time is needed."] - #[serde(rename = "ensembleModelDownloadTimeout", default, skip_serializing_if = "Option::is_none")] - pub ensemble_model_download_timeout: Option, - #[doc = "Advances setting to customize StackEnsemble run."] - #[serde(rename = "stackEnsembleSettings", default, skip_serializing_if = "Option::is_none")] - pub stack_ensemble_settings: Option, - #[doc = "Training mode dictates whether to use distributed training or not"] - #[serde(rename = "trainingMode", default, skip_serializing_if = "Option::is_none")] - pub training_mode: Option, -} -impl TrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Trial component definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrialComponent { - #[doc = "ARM resource ID of the code asset."] - #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] - pub code_id: Option, - #[doc = "[Required] The command to execute on startup of the job. eg. \"python train.py\""] - pub command: String, - #[doc = "Base definition for job distribution configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, - #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId")] - pub environment_id: String, - #[doc = "Environment variables included in the job."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl TrialComponent { - pub fn new(command: String, environment_id: String) -> Self { - Self { - code_id: None, - command, - distribution: None, - environment_id, - environment_variables: None, - resources: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TriggerBase { - #[doc = "Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601.\r\nRecommented format would be \"2022-06-01T00:00:01\"\r\nIf not present, the schedule will run indefinitely"] - #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "Specifies start time of schedule in ISO 8601 format, but without a UTC offset."] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option, - #[serde(rename = "triggerType")] - pub trigger_type: TriggerType, -} -impl TriggerBase { - pub fn new(trigger_type: TriggerType) -> Self { - Self { - end_time: None, - start_time: None, - time_zone: None, - trigger_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "triggerType")] -pub enum TriggerBaseUnion { - Cron(CronTrigger), - Recurrence(RecurrenceTrigger), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TriggerType")] -pub enum TriggerType { - Recurrence, - Cron, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TriggerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TriggerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TriggerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Recurrence => serializer.serialize_unit_variant("TriggerType", 0u32, "Recurrence"), - Self::Cron => serializer.serialize_unit_variant("TriggerType", 1u32, "Cron"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Triton inferencing server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TritonInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Online inference configuration options."] - #[serde(rename = "inferenceConfiguration", default, skip_serializing_if = "Option::is_none")] - pub inference_configuration: Option, -} -impl TritonInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - inference_configuration: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TritonModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl TritonModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TritonModelJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl TritonModelJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "Defines an early termination policy that cancels a given percentage of runs at each evaluation interval."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TruncationSelectionPolicy { - #[serde(flatten)] - pub early_termination_policy: EarlyTerminationPolicy, - #[doc = "The percentage of runs to cancel at each evaluation interval."] - #[serde(rename = "truncationPercentage", default, skip_serializing_if = "Option::is_none")] - pub truncation_percentage: Option, -} -impl TruncationSelectionPolicy { - pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { - Self { - early_termination_policy, - truncation_percentage: None, - } - } -} -#[doc = "The properties for update Quota response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UpdateWorkspaceQuotas { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The maximum permitted quota of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "An enum describing the unit of quota measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "Status of update workspace quota."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl UpdateWorkspaceQuotas { - pub fn new() -> Self { - Self::default() - } -} -pub mod update_workspace_quotas { - use super::*; - #[doc = "An enum describing the unit of quota measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Status of update workspace quota."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Undefined, - Success, - Failure, - InvalidQuotaBelowClusterMinimum, - InvalidQuotaExceedsSubscriptionLimit, - #[serde(rename = "InvalidVMFamilyName")] - InvalidVmFamilyName, - OperationNotSupportedForSku, - OperationNotEnabledForRegion, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Undefined => serializer.serialize_unit_variant("Status", 0u32, "Undefined"), - Self::Success => serializer.serialize_unit_variant("Status", 1u32, "Success"), - Self::Failure => serializer.serialize_unit_variant("Status", 2u32, "Failure"), - Self::InvalidQuotaBelowClusterMinimum => { - serializer.serialize_unit_variant("Status", 3u32, "InvalidQuotaBelowClusterMinimum") - } - Self::InvalidQuotaExceedsSubscriptionLimit => { - serializer.serialize_unit_variant("Status", 4u32, "InvalidQuotaExceedsSubscriptionLimit") - } - Self::InvalidVmFamilyName => serializer.serialize_unit_variant("Status", 5u32, "InvalidVMFamilyName"), - Self::OperationNotSupportedForSku => serializer.serialize_unit_variant("Status", 6u32, "OperationNotSupportedForSku"), - Self::OperationNotEnabledForRegion => serializer.serialize_unit_variant("Status", 7u32, "OperationNotEnabledForRegion"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The result of update workspace quota."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UpdateWorkspaceQuotasResult { - #[doc = "The list of workspace quota update result."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl UpdateWorkspaceQuotasResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "uri-file data version entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFileDataVersion { - #[serde(flatten)] - pub data_version_base: DataVersionBase, -} -impl UriFileDataVersion { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { data_version_base } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFileJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl UriFileJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFileJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl UriFileJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "uri-folder data version entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFolderDataVersion { - #[serde(flatten)] - pub data_version_base: DataVersionBase, -} -impl UriFolderDataVersion { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { data_version_base } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFolderJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl UriFolderJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFolderJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl UriFolderJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "Describes AML Resource Usage."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Usage { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Region of the AML workspace in the id."] - #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] - pub aml_workspace_location: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "An enum describing the unit of usage measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "The current usage of the resource."] - #[serde(rename = "currentValue", default, skip_serializing_if = "Option::is_none")] - pub current_value: Option, - #[doc = "The maximum permitted usage of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "The Usage Names."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, -} -impl Usage { - pub fn new() -> Self { - Self::default() - } -} -pub mod usage { - use super::*; - #[doc = "An enum describing the unit of usage measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The Usage Names."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UsageName { - #[doc = "The name of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The localized name of the resource."] - #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] - pub localized_value: Option, -} -impl UsageName { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configure STL Decomposition of the time-series target column."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "UseStl")] -pub enum UseStl { - None, - Season, - SeasonTrend, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for UseStl { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for UseStl { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for UseStl { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("UseStl", 0u32, "None"), - Self::Season => serializer.serialize_unit_variant("UseStl", 1u32, "Season"), - Self::SeasonTrend => serializer.serialize_unit_variant("UseStl", 2u32, "SeasonTrend"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Settings for user account that gets created on each on the nodes of a compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserAccountCredentials { - #[doc = "Name of the administrator user account which can be used to SSH to nodes."] - #[serde(rename = "adminUserName")] - pub admin_user_name: String, - #[doc = "SSH public key of the administrator user account."] - #[serde(rename = "adminUserSshPublicKey", default, skip_serializing_if = "Option::is_none")] - pub admin_user_ssh_public_key: Option, - #[doc = "Password of the administrator user account."] - #[serde(rename = "adminUserPassword", default, skip_serializing_if = "Option::is_none")] - pub admin_user_password: Option, -} -impl UserAccountCredentials { - pub fn new(admin_user_name: String) -> Self { - Self { - admin_user_name, - admin_user_ssh_public_key: None, - admin_user_password: None, - } - } -} -#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserAssignedIdentities {} -impl UserAssignedIdentities { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "User assigned identity properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserAssignedIdentity { - #[doc = "The principal ID of the assigned identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The client ID of the assigned identity."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, -} -impl UserAssignedIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedAcrAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedStorageAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "User identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserIdentity { - #[serde(flatten)] - pub identity_configuration: IdentityConfiguration, -} -impl UserIdentity { - pub fn new(identity_configuration: IdentityConfiguration) -> Self { - Self { identity_configuration } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UsernamePasswordAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl UsernamePasswordAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Metric computation method to use for validation metrics in image tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ValidationMetricType")] -pub enum ValidationMetricType { - None, - Coco, - Voc, - CocoVoc, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ValidationMetricType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ValidationMetricType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ValidationMetricType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ValidationMetricType", 0u32, "None"), - Self::Coco => serializer.serialize_unit_variant("ValidationMetricType", 1u32, "Coco"), - Self::Voc => serializer.serialize_unit_variant("ValidationMetricType", 2u32, "Voc"), - Self::CocoVoc => serializer.serialize_unit_variant("ValidationMetricType", 3u32, "CocoVoc"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A Machine Learning compute based on Azure Virtual Machines."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct VirtualMachine { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub virtual_machine_schema: VirtualMachineSchema, -} -impl VirtualMachine { - pub fn new(compute: Compute) -> Self { - Self { - compute, - virtual_machine_schema: VirtualMachineSchema::default(), - } - } -} -#[doc = "Virtual Machine image for Windows AML Compute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct VirtualMachineImage { - #[doc = "Virtual Machine image path"] - pub id: String, -} -impl VirtualMachineImage { - pub fn new(id: String) -> Self { - Self { id } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSchema { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl VirtualMachineSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod virtual_machine_schema { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Virtual Machine size"] - #[serde(rename = "virtualMachineSize", default, skip_serializing_if = "Option::is_none")] - pub virtual_machine_size: Option, - #[doc = "Port open for ssh connections."] - #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] - pub ssh_port: Option, - #[doc = "Notebook server port open for ssh connections."] - #[serde(rename = "notebookServerPort", default, skip_serializing_if = "Option::is_none")] - pub notebook_server_port: Option, - #[doc = "Public IP address of the virtual machine."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - #[doc = "Admin credentials for virtual machine"] - #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] - pub administrator_account: Option, - #[doc = "Indicates whether this compute will be used for running notebooks."] - #[serde(rename = "isNotebookInstanceCompute", default, skip_serializing_if = "Option::is_none")] - pub is_notebook_instance_compute: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Secrets related to a Machine Learning compute based on AKS."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct VirtualMachineSecrets { - #[serde(flatten)] - pub compute_secrets: ComputeSecrets, - #[serde(flatten)] - pub virtual_machine_secrets_schema: VirtualMachineSecretsSchema, -} -impl VirtualMachineSecrets { - pub fn new(compute_secrets: ComputeSecrets) -> Self { - Self { - compute_secrets, - virtual_machine_secrets_schema: VirtualMachineSecretsSchema::default(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSecretsSchema { - #[doc = "Admin credentials for virtual machine"] - #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] - pub administrator_account: Option, -} -impl VirtualMachineSecretsSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes the properties of a VM size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSize { - #[doc = "The name of the virtual machine size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The family name of the virtual machine size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "The number of vCPUs supported by the virtual machine size."] - #[serde(rename = "vCPUs", default, skip_serializing_if = "Option::is_none")] - pub v_cp_us: Option, - #[doc = "The number of gPUs supported by the virtual machine size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gpus: Option, - #[doc = "The OS VHD disk size, in MB, allowed by the virtual machine size."] - #[serde(rename = "osVhdSizeMB", default, skip_serializing_if = "Option::is_none")] - pub os_vhd_size_mb: Option, - #[doc = "The resource volume size, in MB, allowed by the virtual machine size."] - #[serde(rename = "maxResourceVolumeMB", default, skip_serializing_if = "Option::is_none")] - pub max_resource_volume_mb: Option, - #[doc = "The amount of memory, in GB, supported by the virtual machine size."] - #[serde(rename = "memoryGB", default, skip_serializing_if = "Option::is_none")] - pub memory_gb: Option, - #[doc = "Specifies if the virtual machine size supports low priority VMs."] - #[serde(rename = "lowPriorityCapable", default, skip_serializing_if = "Option::is_none")] - pub low_priority_capable: Option, - #[doc = "Specifies if the virtual machine size supports premium IO."] - #[serde(rename = "premiumIO", default, skip_serializing_if = "Option::is_none")] - pub premium_io: Option, - #[doc = "The estimated price info for using a VM."] - #[serde(rename = "estimatedVMPrices", default, skip_serializing_if = "Option::is_none")] - pub estimated_vm_prices: Option, - #[doc = "Specifies the compute types supported by the virtual machine size."] - #[serde( - rename = "supportedComputeTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_compute_types: Vec, -} -impl VirtualMachineSize { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List Virtual Machine size operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSizeListResult { - #[doc = "The list of virtual machine sizes supported by AmlCompute."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl VirtualMachineSizeListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Admin credentials for virtual machine"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSshCredentials { - #[doc = "Username of admin account"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[doc = "Password of admin account"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, - #[doc = "Public key data"] - #[serde(rename = "publicKeyData", default, skip_serializing_if = "Option::is_none")] - pub public_key_data: Option, - #[doc = "Private key data"] - #[serde(rename = "privateKeyData", default, skip_serializing_if = "Option::is_none")] - pub private_key_data: Option, -} -impl VirtualMachineSshCredentials { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeDefinition { - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Indicate whether to mount volume as readOnly. Default value for this is false."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option, - #[doc = "Source of the mount. For bind mounts this is the host path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Target of the mount. For bind mounts this is the path in the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Consistency of the volume"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub consistency: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bind: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub volume: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tmpfs: Option, -} -impl VolumeDefinition { - pub fn new() -> Self { - Self::default() - } -} -pub mod volume_definition { - use super::*; - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "bind")] - Bind, - #[serde(rename = "volume")] - Volume, - #[serde(rename = "tmpfs")] - Tmpfs, - #[serde(rename = "npipe")] - Npipe, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bind => serializer.serialize_unit_variant("Type", 0u32, "bind"), - Self::Volume => serializer.serialize_unit_variant("Type", 1u32, "volume"), - Self::Tmpfs => serializer.serialize_unit_variant("Type", 2u32, "tmpfs"), - Self::Npipe => serializer.serialize_unit_variant("Type", 3u32, "npipe"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Bind - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeOptions { - #[doc = "Indicate whether volume is nocopy"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nocopy: Option, -} -impl VolumeOptions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Webhook base"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Webhook { - #[doc = "Send callback on a specified notification event"] - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option, - #[doc = "Enum to determine the webhook callback service type."] - #[serde(rename = "webhookType")] - pub webhook_type: WebhookType, -} -impl Webhook { - pub fn new(webhook_type: WebhookType) -> Self { - Self { - event_type: None, - webhook_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "webhookType")] -pub enum WebhookUnion { - AzureDevOps(AzureDevOpsWebhook), -} -#[doc = "Enum to determine the webhook callback service type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "WebhookType")] -pub enum WebhookType { - AzureDevOps, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for WebhookType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for WebhookType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for WebhookType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureDevOps => serializer.serialize_unit_variant("WebhookType", 0u32, "AzureDevOps"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum of weekday"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "WeekDay")] -pub enum WeekDay { - Monday, - Tuesday, - Wednesday, - Thursday, - Friday, - Saturday, - Sunday, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for WeekDay { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for WeekDay { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for WeekDay { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Monday => serializer.serialize_unit_variant("WeekDay", 0u32, "Monday"), - Self::Tuesday => serializer.serialize_unit_variant("WeekDay", 1u32, "Tuesday"), - Self::Wednesday => serializer.serialize_unit_variant("WeekDay", 2u32, "Wednesday"), - Self::Thursday => serializer.serialize_unit_variant("WeekDay", 3u32, "Thursday"), - Self::Friday => serializer.serialize_unit_variant("WeekDay", 4u32, "Friday"), - Self::Saturday => serializer.serialize_unit_variant("WeekDay", 5u32, "Saturday"), - Self::Sunday => serializer.serialize_unit_variant("WeekDay", 6u32, "Sunday"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "An object that represents a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Workspace { - #[serde(flatten)] - pub resource: Resource, - #[doc = "The properties of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Specifies the location of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Contains resource tags defined as key/value pairs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, -} -impl Workspace { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionAccessKey { - #[serde(rename = "accessKeyId", default, skip_serializing_if = "Option::is_none")] - pub access_key_id: Option, - #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, -} -impl WorkspaceConnectionAccessKey { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionManagedIdentity { - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, -} -impl WorkspaceConnectionManagedIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionPersonalAccessToken { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pat: Option, -} -impl WorkspaceConnectionPersonalAccessToken { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WorkspaceConnectionPropertiesV2 { - #[doc = "Authentication type of the connection target"] - #[serde(rename = "authType")] - pub auth_type: ConnectionAuthType, - #[serde(rename = "expiryTime", default, skip_serializing_if = "Option::is_none")] - pub expiry_time: Option, - #[doc = "Category of the connection"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Value details of the workspace connection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "format for the workspace connection value"] - #[serde(rename = "valueFormat", default, skip_serializing_if = "Option::is_none")] - pub value_format: Option, -} -impl WorkspaceConnectionPropertiesV2 { - pub fn new(auth_type: ConnectionAuthType) -> Self { - Self { - auth_type, - expiry_time: None, - category: None, - target: None, - value: None, - value_format: None, - } - } -} -pub mod workspace_connection_properties_v2 { - use super::*; - #[doc = "format for the workspace connection value"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ValueFormat")] - pub enum ValueFormat { - #[serde(rename = "JSON")] - Json, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ValueFormat { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ValueFormat { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ValueFormat { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Json => serializer.serialize_unit_variant("ValueFormat", 0u32, "JSON"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "authType")] -pub enum WorkspaceConnectionPropertiesV2Union { - AccessKey(AccessKeyAuthTypeWorkspaceConnectionProperties), - ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), - None(NoneAuthTypeWorkspaceConnectionProperties), - #[serde(rename = "PAT")] - Pat(PatAuthTypeWorkspaceConnectionProperties), - #[serde(rename = "SAS")] - Sas(SasAuthTypeWorkspaceConnectionProperties), - ServicePrincipal(ServicePrincipalAuthTypeWorkspaceConnectionProperties), - UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WorkspaceConnectionPropertiesV2BasicResource { - #[serde(flatten)] - pub resource: Resource, - pub properties: WorkspaceConnectionPropertiesV2Union, -} -impl WorkspaceConnectionPropertiesV2BasicResource { - pub fn new(properties: WorkspaceConnectionPropertiesV2Union) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionServicePrincipal { - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, -} -impl WorkspaceConnectionServicePrincipal { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionSharedAccessSignature { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sas: Option, -} -impl WorkspaceConnectionSharedAccessSignature { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionUsernamePassword { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, -} -impl WorkspaceConnectionUsernamePassword { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The result of a request to list machine learning workspaces."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceListResult { - #[doc = "The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI that can be used to request the next list of machine learning workspaces."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for WorkspaceListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl WorkspaceListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceProperties { - #[doc = "The immutable id associated with this workspace."] - #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] - pub workspace_id: Option, - #[doc = "The description of this workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The friendly name for this workspace. This name in mutable"] - #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[doc = "ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created"] - #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] - pub key_vault: Option, - #[doc = "ARM id of the application insights associated with this workspace."] - #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] - pub application_insights: Option, - #[doc = "ARM id of the container registry associated with this workspace."] - #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] - pub container_registry: Option, - #[doc = "ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created"] - #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] - pub storage_account: Option, - #[doc = "Url for the discovery service to identify regional endpoints for machine learning experimentation services"] - #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] - pub discovery_url: Option, - #[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encryption: Option, - #[doc = "The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service"] - #[serde(rename = "hbiWorkspace", default, skip_serializing_if = "Option::is_none")] - pub hbi_workspace: Option, - #[doc = "The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace"] - #[serde(rename = "serviceProvisionedResourceGroup", default, skip_serializing_if = "Option::is_none")] - pub service_provisioned_resource_group: Option, - #[doc = "Count of private connections in the workspace"] - #[serde(rename = "privateLinkCount", default, skip_serializing_if = "Option::is_none")] - pub private_link_count: Option, - #[doc = "The compute name for image build"] - #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] - pub image_build_compute: Option, - #[doc = "The flag to indicate whether to allow public access when behind VNet."] - #[serde(rename = "allowPublicAccessWhenBehindVnet", default, skip_serializing_if = "Option::is_none")] - pub allow_public_access_when_behind_vnet: Option, - #[doc = "Whether requests from Public Network are allowed."] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "The list of private endpoint connections in the workspace."] - #[serde( - rename = "privateEndpointConnections", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub private_endpoint_connections: Vec, - #[doc = "The list of shared private link resources in this workspace."] - #[serde( - rename = "sharedPrivateLinkResources", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub shared_private_link_resources: Vec, - #[serde(rename = "notebookInfo", default, skip_serializing_if = "Option::is_none")] - pub notebook_info: Option, - #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] - pub service_managed_resources_settings: Option, - #[doc = "The user assigned identity resource id that represents the workspace identity."] - #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub primary_user_assigned_identity: Option, - #[doc = "The tenant id associated with this workspace."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "If the storage associated with the workspace has hierarchical namespace(HNS) enabled."] - #[serde(rename = "storageHnsEnabled", default, skip_serializing_if = "Option::is_none")] - pub storage_hns_enabled: Option, - #[doc = "The URI associated with this workspace that machine learning flow must point at to set up tracking."] - #[serde(rename = "mlFlowTrackingUri", default, skip_serializing_if = "Option::is_none")] - pub ml_flow_tracking_uri: Option, - #[doc = "Enabling v1_legacy_mode may prevent you from using features provided by the v2 API."] - #[serde(rename = "v1LegacyMode", default, skip_serializing_if = "Option::is_none")] - pub v1_legacy_mode: Option, - #[doc = "The timestamp when the workspace was soft deleted"] - #[serde(rename = "softDeletedAt", default, skip_serializing_if = "Option::is_none")] - pub soft_deleted_at: Option, - #[doc = "The timestamp when the soft deleted workspace is going to be purged"] - #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")] - pub scheduled_purge_date: Option, - #[doc = "The auth mode used for accessing the system datastores of the workspace"] - #[serde(rename = "systemDatastoresAuthMode", default, skip_serializing_if = "Option::is_none")] - pub system_datastores_auth_mode: Option, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, - #[doc = "Retention time in days after workspace get soft deleted."] - #[serde(rename = "softDeleteRetentionInDays", default, skip_serializing_if = "Option::is_none")] - pub soft_delete_retention_in_days: Option, - #[doc = "A flag to determine if workspace has data isolation enabled. The flag can only be set at the creation phase, it can't be updated."] - #[serde(rename = "enableDataIsolation", default, skip_serializing_if = "Option::is_none")] - pub enable_data_isolation: Option, - #[doc = ": A list of storage accounts used by Hub."] - #[serde( - rename = "storageAccounts", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub storage_accounts: Vec, - #[doc = "A list of key vaults used by Hub."] - #[serde( - rename = "keyVaults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub key_vaults: Vec, - #[doc = "A list of container registries used by Hub."] - #[serde( - rename = "containerRegistries", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub container_registries: Vec, - #[doc = "A list of existing workspaces used by Hub to perform convert."] - #[serde( - rename = "existingWorkspaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub existing_workspaces: Vec, - #[doc = "Resource Id of Hub used for lean workspace."] - #[serde(rename = "hubResourceId", default, skip_serializing_if = "Option::is_none")] - pub hub_resource_id: Option, - #[doc = "A list of lean workspaces associated with Hub."] - #[serde( - rename = "associatedWorkspaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub associated_workspaces: Vec, - #[doc = "Managed Network settings for a machine learning workspace."] - #[serde(rename = "managedNetwork", default, skip_serializing_if = "Option::is_none")] - pub managed_network: Option, -} -impl WorkspaceProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod workspace_properties { - use super::*; - #[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ProvisioningState")] - pub enum ProvisioningState { - Unknown, - Updating, - Creating, - Deleting, - Succeeded, - Failed, - Canceled, - SoftDeleted, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), - Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), - Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), - Self::SoftDeleted => serializer.serialize_unit_variant("ProvisioningState", 7u32, "SoftDeleted"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Whether requests from Public Network are allowed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "PublicNetworkAccess")] - pub enum PublicNetworkAccess { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for PublicNetworkAccess { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for PublicNetworkAccess { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for PublicNetworkAccess { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The parameters for updating the properties of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspacePropertiesUpdateParameters { - #[doc = "The description of this workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The friendly name for this workspace."] - #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[doc = "The compute name for image build"] - #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] - pub image_build_compute: Option, - #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] - pub service_managed_resources_settings: Option, - #[doc = "The user assigned identity resource id that represents the workspace identity."] - #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub primary_user_assigned_identity: Option, - #[doc = "Whether requests from Public Network are allowed."] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "ARM id of the application insights associated with this workspace."] - #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] - pub application_insights: Option, - #[doc = "ARM id of the container registry associated with this workspace."] - #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] - pub container_registry: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encryption: Option, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, - #[doc = "Managed Network settings for a machine learning workspace."] - #[serde(rename = "managedNetwork", default, skip_serializing_if = "Option::is_none")] - pub managed_network: Option, -} -impl WorkspacePropertiesUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -pub mod workspace_properties_update_parameters { - use super::*; - #[doc = "Whether requests from Public Network are allowed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "PublicNetworkAccess")] - pub enum PublicNetworkAccess { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for PublicNetworkAccess { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for PublicNetworkAccess { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for PublicNetworkAccess { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The parameters for updating a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceUpdateParameters { - #[doc = "The resource tags for the machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "The parameters for updating the properties of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl WorkspaceUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Metadata pertaining to creation and last modification of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemData { - #[doc = "The identity that created the resource."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The type of identity that created the resource."] - #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] - pub created_by_type: Option, - #[doc = "The timestamp of resource creation (UTC)."] - #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] - pub created_at: Option, - #[doc = "The identity that last modified the resource."] - #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by: Option, - #[doc = "The type of identity that last modified the resource."] - #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] - #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] - pub last_modified_at: Option, -} -impl SystemData { - pub fn new() -> Self { - Self::default() - } -} -pub mod system_data { - use super::*; - #[doc = "The type of identity that created the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreatedByType")] - pub enum CreatedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreatedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreatedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreatedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of identity that last modified the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LastModifiedByType")] - pub enum LastModifiedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LastModifiedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LastModifiedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LastModifiedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/machinelearningservices/src/package_preview_2023_06/mod.rs b/services/mgmt/machinelearningservices/src/package_preview_2023_06/mod.rs deleted file mode 100644 index 922f028000..0000000000 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_06/mod.rs +++ /dev/null @@ -1,31679 +0,0 @@ -#![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, - scopes: Vec, - pipeline: azure_core::Pipeline, -} -#[derive(Clone)] -pub struct ClientBuilder { - credential: std::sync::Arc, - endpoint: Option, - scopes: Option>, - 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) -> 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) -> 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) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into) -> 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 { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: std::sync::Arc) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into, - credential: std::sync::Arc, - scopes: Vec, - 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 batch_deployments_client(&self) -> batch_deployments::Client { - batch_deployments::Client(self.clone()) - } - pub fn batch_endpoints_client(&self) -> batch_endpoints::Client { - batch_endpoints::Client(self.clone()) - } - pub fn code_containers_client(&self) -> code_containers::Client { - code_containers::Client(self.clone()) - } - pub fn code_versions_client(&self) -> code_versions::Client { - code_versions::Client(self.clone()) - } - pub fn component_containers_client(&self) -> component_containers::Client { - component_containers::Client(self.clone()) - } - pub fn component_versions_client(&self) -> component_versions::Client { - component_versions::Client(self.clone()) - } - pub fn compute_client(&self) -> compute::Client { - compute::Client(self.clone()) - } - pub fn data_containers_client(&self) -> data_containers::Client { - data_containers::Client(self.clone()) - } - pub fn data_versions_client(&self) -> data_versions::Client { - data_versions::Client(self.clone()) - } - pub fn datastores_client(&self) -> datastores::Client { - datastores::Client(self.clone()) - } - pub fn environment_containers_client(&self) -> environment_containers::Client { - environment_containers::Client(self.clone()) - } - pub fn environment_versions_client(&self) -> environment_versions::Client { - environment_versions::Client(self.clone()) - } - pub fn features_client(&self) -> features::Client { - features::Client(self.clone()) - } - pub fn featureset_containers_client(&self) -> featureset_containers::Client { - featureset_containers::Client(self.clone()) - } - pub fn featureset_versions_client(&self) -> featureset_versions::Client { - featureset_versions::Client(self.clone()) - } - pub fn featurestore_entity_containers_client(&self) -> featurestore_entity_containers::Client { - featurestore_entity_containers::Client(self.clone()) - } - pub fn featurestore_entity_versions_client(&self) -> featurestore_entity_versions::Client { - featurestore_entity_versions::Client(self.clone()) - } - pub fn jobs_client(&self) -> jobs::Client { - jobs::Client(self.clone()) - } - pub fn labeling_jobs_client(&self) -> labeling_jobs::Client { - labeling_jobs::Client(self.clone()) - } - pub fn managed_network_provisions_client(&self) -> managed_network_provisions::Client { - managed_network_provisions::Client(self.clone()) - } - pub fn managed_network_settings_rule_client(&self) -> managed_network_settings_rule::Client { - managed_network_settings_rule::Client(self.clone()) - } - pub fn model_containers_client(&self) -> model_containers::Client { - model_containers::Client(self.clone()) - } - pub fn model_versions_client(&self) -> model_versions::Client { - model_versions::Client(self.clone()) - } - pub fn online_deployments_client(&self) -> online_deployments::Client { - online_deployments::Client(self.clone()) - } - pub fn online_endpoints_client(&self) -> online_endpoints::Client { - online_endpoints::Client(self.clone()) - } - pub fn operations_client(&self) -> operations::Client { - operations::Client(self.clone()) - } - pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { - private_endpoint_connections::Client(self.clone()) - } - pub fn private_link_resources_client(&self) -> private_link_resources::Client { - private_link_resources::Client(self.clone()) - } - pub fn quotas_client(&self) -> quotas::Client { - quotas::Client(self.clone()) - } - pub fn registries_client(&self) -> registries::Client { - registries::Client(self.clone()) - } - pub fn registry_code_containers_client(&self) -> registry_code_containers::Client { - registry_code_containers::Client(self.clone()) - } - pub fn registry_code_versions_client(&self) -> registry_code_versions::Client { - registry_code_versions::Client(self.clone()) - } - pub fn registry_component_containers_client(&self) -> registry_component_containers::Client { - registry_component_containers::Client(self.clone()) - } - pub fn registry_component_versions_client(&self) -> registry_component_versions::Client { - registry_component_versions::Client(self.clone()) - } - pub fn registry_data_containers_client(&self) -> registry_data_containers::Client { - registry_data_containers::Client(self.clone()) - } - pub fn registry_data_versions_client(&self) -> registry_data_versions::Client { - registry_data_versions::Client(self.clone()) - } - pub fn registry_environment_containers_client(&self) -> registry_environment_containers::Client { - registry_environment_containers::Client(self.clone()) - } - pub fn registry_environment_versions_client(&self) -> registry_environment_versions::Client { - registry_environment_versions::Client(self.clone()) - } - pub fn registry_model_containers_client(&self) -> registry_model_containers::Client { - registry_model_containers::Client(self.clone()) - } - pub fn registry_model_versions_client(&self) -> registry_model_versions::Client { - registry_model_versions::Client(self.clone()) - } - pub fn schedules_client(&self) -> schedules::Client { - schedules::Client(self.clone()) - } - pub fn usages_client(&self) -> usages::Client { - usages::Client(self.clone()) - } - pub fn virtual_machine_sizes_client(&self) -> virtual_machine_sizes::Client { - virtual_machine_sizes::Client(self.clone()) - } - pub fn workspace_connections_client(&self) -> workspace_connections::Client { - workspace_connections::Client(self.clone()) - } - pub fn workspace_features_client(&self) -> workspace_features::Client { - workspace_features::Client(self.clone()) - } - pub fn workspaces_client(&self) -> workspaces::Client { - workspaces::Client(self.clone()) - } -} -pub mod usages { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the current usage information as well as limits for AML resources for given subscription and location."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `location`: The location for which resource usage is queried."] - pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - location: location.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListUsagesResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) location: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/usages", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod virtual_machine_sizes { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns supported VM Sizes in a location"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `location`: The location upon which virtual-machine-sizes is queried."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list(&self, location: impl Into, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - location: location.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::VirtualMachineSizeListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) location: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/vmSizes", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod quotas { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Update quota for each VM family in workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `location`: The location for update quota is queried."] - #[doc = "* `parameters`: Quota update parameters."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn update( - &self, - location: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - location: location.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the currently assigned Workspace Quotas based on VMFamily."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `location`: The location for which resource usage is queried."] - pub fn list(&self, subscription_id: impl Into, location: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - location: location.into(), - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UpdateWorkspaceQuotasResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) location: String, - pub(crate) parameters: models::QuotaUpdateParameters, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/updateQuotas", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListWorkspaceQuotas = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) location: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/locations/{}/quotas", - self.client.endpoint(), - &self.subscription_id, - &self.location - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod compute { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets computes in specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - } - } - #[doc = "Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: Payload with Machine Learning compute definition."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: Additional parameters for cluster update."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes specified Machine Learning compute."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `underlying_resource_action`: Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - underlying_resource_action: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - underlying_resource_action: underlying_resource_action.into(), - } - } - #[doc = "Updates the custom services list. The list of custom services provided shall be overwritten"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `custom_services`: New list of Custom Services."] - pub fn update_custom_services( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - custom_services: Vec, - ) -> update_custom_services::RequestBuilder { - update_custom_services::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - custom_services, - } - } - #[doc = "Get the details (e.g IP address, port etc) of all the compute nodes in the compute."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn list_nodes( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> list_nodes::RequestBuilder { - list_nodes::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Gets secrets related to Machine Learning compute (storage keys, service credentials, etc)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Posts a start action to a compute instance"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn start( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> start::RequestBuilder { - start::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Posts a stop action to a compute instance"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn stop( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> stop::RequestBuilder { - stop::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Posts a restart action to a compute instance"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - pub fn restart( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - ) -> restart::RequestBuilder { - restart::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - } - } - #[doc = "Updates the idle shutdown setting of a compute instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `compute_name`: Name of the Azure Machine Learning compute."] - #[doc = "* `parameters`: The object for updating idle shutdown setting of specified ComputeInstance."] - pub fn update_idle_shutdown_setting( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - compute_name: impl Into, - parameters: impl Into, - ) -> update_idle_shutdown_setting::RequestBuilder { - update_idle_shutdown_setting::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - compute_name: compute_name.into(), - parameters: parameters.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PaginatedComputeResourcesList = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::ComputeResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::ClusterUpdateParameters, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) underlying_resource_action: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let underlying_resource_action = &this.underlying_resource_action; - req.url_mut() - .query_pairs_mut() - .append_pair("underlyingResourceAction", underlying_resource_action); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod update_custom_services { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) custom_services: Vec, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.custom_services)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/customServices" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list_nodes { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AmlComputeNodesInformation = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - 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()), - ); - 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, "2023-06-01-preview"); - } - 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::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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listNodes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComputeSecretsUnion = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/listKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod start { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/start", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod stop { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/stop", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod restart { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/restart", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.compute_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod update_idle_shutdown_setting { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) compute_name: String, - pub(crate) parameters: models::IdleShutdownSetting, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/computes/{}/updateIdleShutdownSetting" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . compute_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_code_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - } - } - #[doc = "Get Code container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - } - } - #[doc = "Create or update Code container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - body: body.into(), - } - } - #[doc = "Delete Code container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) body: models::CodeContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a code asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `code_name`: Pending upload name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - code_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - code_name: code_name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.code_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) code_name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/codes/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . code_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod registry_component_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) body: models::ComponentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.component_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - order_by: None, - top: None, - skip: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `component_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - component_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - component_name: component_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Component stage."] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) component_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . component_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_data_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Data containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) body: models::DataContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_data_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data versions in the data container"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Data container's name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - tags: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a data asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `name`: Data asset name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/data/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod registry_environment_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List environment containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) body: models::EnvironmentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.environment_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_environment_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `environment_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - environment_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - environment_name: environment_name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "Stage for including/excluding (for example) archived entities. Takes priority over listViewType"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) environment_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . environment_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_model_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - } - } - #[doc = "Create or update model container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) body: models::ModelContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registry_model_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - skip: None, - order_by: None, - top: None, - version: None, - description: None, - tags: None, - properties: None, - list_view_type: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - } - } - #[doc = "Model Version Package operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Package operation request body."] - pub fn package( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - body: impl Into, - ) -> package::RequestBuilder { - package::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a model asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `model_name`: Model name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - model_name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - model_name: model_name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Version identifier."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name, - &self.model_name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod package { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageResponse = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - pub(crate) body: models::PackageRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}/package" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . model_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) model_name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/models/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . registry_name , & self . model_name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod batch_endpoints { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference endpoint in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - count: None, - skip: None, - } - } - #[doc = "Gets a batch inference endpoint by name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch Endpoint."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Creates a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Batch inference endpoint definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Name for the Batch inference endpoint."] - #[doc = "* `body`: Mutable batch inference endpoint definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Lists batch Inference Endpoint keys."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::BatchEndpointTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/listkeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod batch_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Batch inference deployments in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Gets a batch inference deployment by id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch deployments."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Creates/updates a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update a batch inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name"] - #[doc = "* `deployment_name`: The identifier for the Batch inference deployment."] - #[doc = "* `body`: Batch inference deployment definition object."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Batch Inference deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Endpoint name"] - #[doc = "* `deployment_name`: Inference deployment identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::BatchDeploymentTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BatchDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/batchEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::CodeContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod code_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - hash: None, - hash_version: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Generate a storage location and credential for the client to upload a code asset to."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Pending upload request object"] - pub fn create_or_get_start_pending_upload( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_get_start_pending_upload::RequestBuilder { - create_or_get_start_pending_upload::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) hash: Option, - pub(crate) hash_version: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "If specified, return CodeVersion assets with specified content hash value, regardless of name"] - pub fn hash(mut self, hash: impl Into) -> Self { - self.hash = Some(hash.into()); - self - } - #[doc = "Hash algorithm version when listing by hash"] - pub fn hash_version(mut self, hash_version: impl Into) -> Self { - self.hash_version = Some(hash_version.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(hash) = &this.hash { - req.url_mut().query_pairs_mut().append_pair("hash", hash); - } - if let Some(hash_version) = &this.hash_version { - req.url_mut().query_pairs_mut().append_pair("hashVersion", hash_version); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::CodeVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod create_or_get_start_pending_upload { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PendingUploadResponseDto = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::PendingUploadRequestDto, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/codes/{}/versions/{}/startPendingUpload" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod component_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List component containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ComponentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod component_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List component versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Component name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "Component stage."] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ComponentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ComponentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/components/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod data_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::DataContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod data_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List data versions in the data container"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Data container's name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - tags: None, - list_view_type: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name."] - #[doc = "* `version`: Version identifier."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Please choose OrderBy value from ['createdtime', 'modifiedtime']"] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top count of results, top count cannot be greater than the page size.\r\n If topCount > page size, results with be default page size count will be returned"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "data stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("$tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataVersionBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::DataVersionBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/data/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod datastores { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List datastores."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - count: None, - is_default: None, - names: Vec::new(), - search_text: None, - order_by: None, - order_by_asc: None, - } - } - #[doc = "Get datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - #[doc = "* `body`: Datastore entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - skip_validation: None, - } - } - #[doc = "Delete datastore."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Get datastore secrets."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Datastore name."] - pub fn list_secrets( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) is_default: Option, - pub(crate) names: Vec, - pub(crate) search_text: Option, - pub(crate) order_by: Option, - pub(crate) order_by_asc: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Filter down to the workspace default datastore."] - pub fn is_default(mut self, is_default: bool) -> Self { - self.is_default = Some(is_default); - self - } - #[doc = "Names of datastores to return."] - pub fn names(mut self, names: Vec) -> Self { - self.names = names; - self - } - #[doc = "Text to search for in the datastore names."] - pub fn search_text(mut self, search_text: impl Into) -> Self { - self.search_text = Some(search_text.into()); - self - } - #[doc = "Order by property (createdtime | modifiedtime | name)."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Order by property in ascending order."] - pub fn order_by_asc(mut self, order_by_asc: bool) -> Self { - self.order_by_asc = Some(order_by_asc); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(is_default) = &this.is_default { - req.url_mut().query_pairs_mut().append_pair("isDefault", &is_default.to_string()); - } - if let Some(search_text) = &this.search_text { - req.url_mut().query_pairs_mut().append_pair("searchText", search_text); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); - } - if let Some(order_by_asc) = &this.order_by_asc { - req.url_mut().query_pairs_mut().append_pair("orderByAsc", &order_by_asc.to_string()); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::DatastoreResource, - pub(crate) skip_validation: Option, - } - impl RequestBuilder { - #[doc = "Flag to skip validation."] - pub fn skip_validation(mut self, skip_validation: bool) -> Self { - self.skip_validation = Some(skip_validation); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(skip_validation) = &this.skip_validation { - req.url_mut() - .query_pairs_mut() - .append_pair("skipValidation", &skip_validation.to_string()); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list_secrets { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DatastoreSecretsUnion = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/datastores/{}/listSecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod environment_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List environment containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::EnvironmentContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod environment_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - order_by: None, - top: None, - skip: None, - list_view_type: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Creates or updates an EnvironmentVersion."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Name of EnvironmentVersion. This is case-sensitive."] - #[doc = "* `version`: Version of EnvironmentVersion."] - #[doc = "* `body`: Definition of EnvironmentVersion."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "Stage for including/excluding (for example) archived entities. Takes priority over listViewType"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::EnvironmentVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/environments/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featureset_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List featurestore entity containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - name: None, - description: None, - created_by: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get_entity( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get_entity::RequestBuilder { - get_entity::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) name: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featureset"] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "description for the feature set"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get_entity { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::FeaturesetContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod features { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Features."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `featureset_name`: Featureset name. This is case-sensitive."] - #[doc = "* `featureset_version`: Featureset Version identifier. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - featureset_name: impl Into, - featureset_version: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - featureset_name: featureset_name.into(), - featureset_version: featureset_version.into(), - skip: None, - tags: None, - feature_name: None, - description: None, - } - } - #[doc = "Get feature."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `featureset_name`: Feature set name. This is case-sensitive."] - #[doc = "* `featureset_version`: Feature set version identifier. This is case-sensitive."] - #[doc = "* `feature_name`: Feature Name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - featureset_name: impl Into, - featureset_version: impl Into, - feature_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - featureset_name: featureset_name.into(), - featureset_version: featureset_version.into(), - feature_name: feature_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeatureResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) featureset_name: String, - pub(crate) featureset_version: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) feature_name: Option, - pub(crate) description: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "feature name."] - pub fn feature_name(mut self, feature_name: impl Into) -> Self { - self.feature_name = Some(feature_name.into()); - self - } - #[doc = "Description of the featureset."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(feature_name) = &this.feature_name { - req.url_mut().query_pairs_mut().append_pair("featureName", feature_name); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/features" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . featureset_name , & self . featureset_version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeatureResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) featureset_name: String, - pub(crate) featureset_version: String, - pub(crate) feature_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/features/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . featureset_name , & self . featureset_version , & self . feature_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod featureset_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Featureset name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - version_name: None, - version: None, - description: None, - created_by: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Backfill."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Feature set version backfill request entity."] - pub fn backfill( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> backfill::RequestBuilder { - backfill::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "List materialization Jobs."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn list_materialization_jobs( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> list_materialization_jobs::RequestBuilder { - list_materialization_jobs::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - skip: None, - filters: None, - feature_window_start: None, - feature_window_end: None, - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) version_name: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featureset version"] - pub fn version_name(mut self, version_name: impl Into) -> Self { - self.version_name = Some(version_name.into()); - self - } - #[doc = "featureset version"] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "description for the feature set version"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - #[doc = "Specifies the featurestore stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(version_name) = &this.version_name { - req.url_mut().query_pairs_mut().append_pair("versionName", version_name); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturesetVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod backfill { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetJob = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturesetVersionBackfillRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/backfill" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod list_materialization_jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturesetJobArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) skip: Option, - pub(crate) filters: Option, - pub(crate) feature_window_start: Option, - pub(crate) feature_window_end: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn filters(mut self, filters: impl Into) -> Self { - self.filters = Some(filters.into()); - self - } - #[doc = "Start time of the feature window to filter materialization jobs."] - pub fn feature_window_start(mut self, feature_window_start: impl Into) -> Self { - self.feature_window_start = Some(feature_window_start.into()); - self - } - #[doc = "End time of the feature window to filter materialization jobs."] - pub fn feature_window_end(mut self, feature_window_end: impl Into) -> Self { - self.feature_window_end = Some(feature_window_end.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - 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()), - ); - 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, "2023-06-01-preview"); - } - 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::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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(filters) = &this.filters { - req.url_mut().query_pairs_mut().append_pair("filters", filters); - } - if let Some(feature_window_start) = &this.feature_window_start { - req.url_mut() - .query_pairs_mut() - .append_pair("featureWindowStart", feature_window_start); - } - if let Some(feature_window_end) = &this.feature_window_end { - req.url_mut().query_pairs_mut().append_pair("featureWindowEnd", feature_window_end); - } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featuresets/{}/versions/{}/listMaterializationJobs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featurestore_entity_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List featurestore entity containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - name: None, - description: None, - created_by: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get_entity( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get_entity::RequestBuilder { - get_entity::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) name: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featurestore entity"] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "description for the featurestore entity"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get_entity { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityContainerResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::FeaturestoreEntityContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod featurestore_entity_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Feature entity name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - tags: None, - list_view_type: None, - page_size: None, - version_name: None, - version: None, - description: None, - created_by: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) list_view_type: Option, - pub(crate) page_size: Option, - pub(crate) version_name: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) created_by: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "page size"] - pub fn page_size(mut self, page_size: i32) -> Self { - self.page_size = Some(page_size); - self - } - #[doc = "name for the featurestore entity version"] - pub fn version_name(mut self, version_name: impl Into) -> Self { - self.version_name = Some(version_name.into()); - self - } - #[doc = "featurestore entity version"] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "description for the feature entity version"] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "createdBy user name"] - pub fn created_by(mut self, created_by: impl Into) -> Self { - self.created_by = Some(created_by.into()); - self - } - #[doc = "Specifies the featurestore stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(page_size) = &this.page_size { - req.url_mut().query_pairs_mut().append_pair("pageSize", &page_size.to_string()); - } - if let Some(version_name) = &this.version_name { - req.url_mut().query_pairs_mut().append_pair("versionName", version_name); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(created_by) = &this.created_by { - req.url_mut().query_pairs_mut().append_pair("createdBy", created_by); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeaturestoreEntityVersionResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::FeaturestoreEntityVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/featurestoreEntities/{}/versions/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists Jobs in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - job_type: None, - tag: None, - list_view_type: None, - asset_name: None, - scheduled: None, - schedule_id: None, - } - } - #[doc = "Gets a Job by name/id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Creates and executes a Job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - #[doc = "* `body`: Job definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Updates a Job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - #[doc = "* `body`: Job definition to apply during the operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Deletes a Job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Cancels a Job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the Job. This is case-sensitive."] - pub fn cancel( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> cancel::RequestBuilder { - cancel::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) job_type: Option, - pub(crate) tag: Option, - pub(crate) list_view_type: Option, - pub(crate) asset_name: Option, - pub(crate) scheduled: Option, - pub(crate) schedule_id: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Type of job to be returned."] - pub fn job_type(mut self, job_type: impl Into) -> Self { - self.job_type = Some(job_type.into()); - self - } - #[doc = "Jobs returned will have this tag key."] - pub fn tag(mut self, tag: impl Into) -> Self { - self.tag = Some(tag.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "Asset name the job's named output is registered with"] - pub fn asset_name(mut self, asset_name: impl Into) -> Self { - self.asset_name = Some(asset_name.into()); - self - } - #[doc = "Indicator whether the job is scheduled job."] - pub fn scheduled(mut self, scheduled: bool) -> Self { - self.scheduled = Some(scheduled); - self - } - #[doc = "The scheduled id for listing the job triggered from"] - pub fn schedule_id(mut self, schedule_id: impl Into) -> Self { - self.schedule_id = Some(schedule_id.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(job_type) = &this.job_type { - req.url_mut().query_pairs_mut().append_pair("jobType", job_type); - } - if let Some(tag) = &this.tag { - req.url_mut().query_pairs_mut().append_pair("tag", tag); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(asset_name) = &this.asset_name { - req.url_mut().query_pairs_mut().append_pair("assetName", asset_name); - } - if let Some(scheduled) = &this.scheduled { - req.url_mut().query_pairs_mut().append_pair("scheduled", &scheduled.to_string()); - } - if let Some(schedule_id) = &this.schedule_id { - req.url_mut().query_pairs_mut().append_pair("scheduleId", schedule_id); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::JobBaseResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::JobBaseResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::PartialJobBasePartialResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod cancel { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/jobs/{}/cancel", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod labeling_jobs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists labeling jobs in the workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - top: None, - } - } - #[doc = "Gets a labeling job by name/id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - include_job_instructions: None, - include_label_categories: None, - } - } - #[doc = "Creates or updates a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: LabelingJob definition object."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Delete a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Export labels from a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - #[doc = "* `body`: The export summary."] - pub fn export_labels( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - body: impl Into, - ) -> export_labels::RequestBuilder { - export_labels::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - body: body.into(), - } - } - #[doc = "Pause a labeling job."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn pause( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> pause::RequestBuilder { - pause::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - #[doc = "Resume a labeling job (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `id`: The name and identifier for the LabelingJob."] - pub fn resume( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - id: impl Into, - ) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) top: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Number of labeling jobs to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) include_job_instructions: Option, - pub(crate) include_label_categories: Option, - } - impl RequestBuilder { - #[doc = "Boolean value to indicate whether to include JobInstructions in response."] - pub fn include_job_instructions(mut self, include_job_instructions: bool) -> Self { - self.include_job_instructions = Some(include_job_instructions); - self - } - #[doc = "Boolean value to indicate Whether to include LabelCategories in response."] - pub fn include_label_categories(mut self, include_label_categories: bool) -> Self { - self.include_label_categories = Some(include_label_categories); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(include_job_instructions) = &this.include_job_instructions { - req.url_mut() - .query_pairs_mut() - .append_pair("includeJobInstructions", &include_job_instructions.to_string()); - } - if let Some(include_label_categories) = &this.include_label_categories { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLabelCategories", &include_label_categories.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LabelingJobResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::LabelingJobResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod export_labels { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExportSummaryUnion = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - pub(crate) body: models::ExportSummaryUnion, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/exportLabels" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod pause { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/pause", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod resume { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/labelingJobs/{}/resume" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . id)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod model_containers { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model containers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - count: None, - list_view_type: None, - } - } - #[doc = "Get container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `body`: Container entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) count: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Maximum number of results to return."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelContainerResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ModelContainerResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod model_versions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List model versions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Model name. This is case-sensitive."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - skip: None, - order_by: None, - top: None, - version: None, - description: None, - offset: None, - tags: None, - properties: None, - feed: None, - list_view_type: None, - stage: None, - } - } - #[doc = "Get version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Create or update version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Version entity to create or update."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - #[doc = "Delete version."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - } - } - #[doc = "Model Version Package operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Container name. This is case-sensitive."] - #[doc = "* `version`: Version identifier. This is case-sensitive."] - #[doc = "* `body`: Package operation request body."] - pub fn package( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - version: impl Into, - body: impl Into, - ) -> package::RequestBuilder { - package::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - version: version.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) skip: Option, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) version: Option, - pub(crate) description: Option, - pub(crate) offset: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) feed: Option, - pub(crate) list_view_type: Option, - pub(crate) stage: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Maximum number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Model version."] - pub fn version(mut self, version: impl Into) -> Self { - self.version = Some(version.into()); - self - } - #[doc = "Model description."] - pub fn description(mut self, description: impl Into) -> Self { - self.description = Some(description.into()); - self - } - #[doc = "Number of initial results to skip."] - pub fn offset(mut self, offset: i32) -> Self { - self.offset = Some(offset); - self - } - #[doc = "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2"] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2"] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "Name of the feed."] - pub fn feed(mut self, feed: impl Into) -> Self { - self.feed = Some(feed.into()); - self - } - #[doc = "View type for including/excluding (for example) archived entities."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - #[doc = "Model stage"] - pub fn stage(mut self, stage: impl Into) -> Self { - self.stage = Some(stage.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(version) = &this.version { - req.url_mut().query_pairs_mut().append_pair("version", version); - } - if let Some(description) = &this.description { - req.url_mut().query_pairs_mut().append_pair("description", description); - } - if let Some(offset) = &this.offset { - req.url_mut().query_pairs_mut().append_pair("offset", &offset.to_string()); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(feed) = &this.feed { - req.url_mut().query_pairs_mut().append_pair("feed", feed); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - if let Some(stage) = &this.stage { - req.url_mut().query_pairs_mut().append_pair("stage", stage); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ModelVersionResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::ModelVersionResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name, - &self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod package { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageResponse = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) version: String, - pub(crate) body: models::PackageRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/models/{}/versions/{}/package" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . name , & self . version)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } -} -pub mod online_endpoints { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Online Endpoints."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: None, - count: None, - compute_type: None, - skip: None, - tags: None, - properties: None, - order_by: None, - } - } - #[doc = "Get Online Endpoint."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Create or update Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Delete Online Endpoint (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "List EndpointAuthKeys for an Endpoint using Key-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - #[doc = "Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `body`: RegenerateKeys request ."] - pub fn regenerate_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - body: impl Into, - ) -> regenerate_keys::RequestBuilder { - regenerate_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - body: body.into(), - } - } - #[doc = "Retrieve a valid AML token for an Endpoint using AMLToken-based authentication."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - pub fn get_token( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> get_token::RequestBuilder { - get_token::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: Option, - pub(crate) count: Option, - pub(crate) compute_type: Option, - pub(crate) skip: Option, - pub(crate) tags: Option, - pub(crate) properties: Option, - pub(crate) order_by: Option, - } - impl RequestBuilder { - #[doc = "Name of the endpoint."] - pub fn name(mut self, name: impl Into) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "Number of endpoints to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "EndpointComputeType to be filtered by."] - pub fn compute_type(mut self, compute_type: impl Into) -> Self { - self.compute_type = Some(compute_type.into()); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 ."] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 ."] - pub fn properties(mut self, properties: impl Into) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "The option to order the response."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(compute_type) = &this.compute_type { - req.url_mut().query_pairs_mut().append_pair("computeType", compute_type); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(properties) = &this.properties { - req.url_mut().query_pairs_mut().append_pair("properties", properties); - } - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("orderBy", order_by); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::OnlineEndpointTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineEndpointTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithIdentity, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.endpoint_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthKeys = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/listKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod regenerate_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) body: models::RegenerateEndpointKeysRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/regenerateKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get_token { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EndpointAuthToken = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/token" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod online_deployments { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List Inference Endpoint Deployments."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - order_by: None, - top: None, - skip: None, - } - } - #[doc = "Get Inference Deployment Deployment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Create or update Inference Endpoint Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Inference Endpoint entity to apply during operation."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Update Online Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Online Endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - #[doc = "* `body`: Online Endpoint entity to apply during operation."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "Delete Inference Endpoint Deployment (asynchronous)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - } - } - #[doc = "Polls an Endpoint operation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: The name and identifier for the endpoint."] - #[doc = "* `body`: The request containing parameters for retrieving logs."] - pub fn get_logs( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - body: impl Into, - ) -> get_logs::RequestBuilder { - get_logs::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - body: body.into(), - } - } - #[doc = "List Inference Endpoint Deployment Skus."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `endpoint_name`: Inference endpoint name."] - #[doc = "* `deployment_name`: Inference Endpoint Deployment name."] - pub fn list_skus( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - endpoint_name: impl Into, - deployment_name: impl Into, - ) -> list_skus::RequestBuilder { - list_skus::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - endpoint_name: endpoint_name.into(), - deployment_name: deployment_name.into(), - count: None, - skip: None, - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) order_by: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Ordering of list."] - pub fn order_by(mut self, order_by: impl Into) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "Top of list."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(order_by) = &this.order_by { - req.url_mut().query_pairs_mut().append_pair("$orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::OnlineDeploymentTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OnlineDeploymentTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::PartialMinimalTrackedResourceWithSku, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get_logs { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentLogs = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) body: models::DeploymentLogsRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/getLogs" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_skus { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SkuResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) endpoint_name: String, - pub(crate) deployment_name: String, - pub(crate) count: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Number of Skus to be retrieved in a page of results."] - pub fn count(mut self, count: i32) -> Self { - self.count = Some(count); - self - } - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(count) = &this.count { - req.url_mut().query_pairs_mut().append_pair("count", &count.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/onlineEndpoints/{}/deployments/{}/skus" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . endpoint_name , & self . deployment_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod schedules { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List schedules in specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - skip: None, - list_view_type: None, - } - } - #[doc = "Get schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Create or update schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - #[doc = "* `body`: Schedule definition."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - body: body.into(), - } - } - #[doc = "Delete schedule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `name`: Schedule name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) skip: Option, - pub(crate) list_view_type: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Status filter for schedule."] - pub fn list_view_type(mut self, list_view_type: impl Into) -> Self { - self.list_view_type = Some(list_view_type.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(list_view_type) = &this.list_view_type { - req.url_mut().query_pairs_mut().append_pair("listViewType", list_view_type); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScheduleResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation status."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This [`RequestBuilder`] implements a request that returns an"] - #[doc = r" unsupported Long Running Operation (LRO). Currently, the"] - #[doc = r" implementation does not support polling the status of the"] - #[doc = r" operation, however future versions of this crate may include"] - #[doc = r" this support."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request. Future versions may poll the service"] - #[doc = r" until the operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) body: models::ScheduleResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "This operation uses a method of polling the status of a long running operation that is not yet supported. Only the first response will be fetched."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/schedules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod registries { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List registries by subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "List registries"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - } - } - #[doc = "Get registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - } - } - #[doc = "Create or update registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - #[doc = "Update tags"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - #[doc = "Delete registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - } - } - #[doc = "Remove regions from registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `registry_name`: Name of Azure Machine Learning registry. This is case-insensitive"] - #[doc = "* `body`: Details required to create the registry."] - pub fn remove_regions( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - registry_name: impl Into, - body: impl Into, - ) -> remove_regions::RequestBuilder { - remove_regions::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - registry_name: registry_name.into(), - body: body.into(), - } - } - } - pub mod list_by_subscription { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::RegistryTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::AzureAsyncOperation)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::PartialRegistryPartialTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod remove_regions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegistryTrackedResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Timeout for the client to use when polling the asynchronous operation."] - pub fn x_ms_async_operation_timeout(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("x-ms-async-operation-timeout")) - } - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) registry_name: String, - pub(crate) body: models::RegistryTrackedResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/registries/{}/removeRegions", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.registry_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } -} -pub mod workspace_features { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all enabled features for a workspace"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListAmlUserFeatureResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/features", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod operations { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all of the available Azure Machine Learning Workspaces REST API operations"] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AmlOperationListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - } - impl RequestBuilder { - #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] - #[doc = ""] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.MachineLearningServices/operations", - self.client.endpoint(), - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod workspaces { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all the available machine learning workspaces under the specified subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - skip: None, - kind: None, - } - } - #[doc = "Lists all the available machine learning workspaces under the specified resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn list_by_resource_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> 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(), - skip: None, - kind: None, - } - } - #[doc = "Gets the properties of the specified machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Creates or updates a workspace with the specified parameters."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `body`: The parameters for creating or updating a machine learning workspace."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - body: body.into(), - } - } - #[doc = "Updates a machine learning workspace with the specified parameters."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `body`: The parameters for updating a machine learning workspace."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - body: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - body: body.into(), - } - } - #[doc = "Deletes a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - force_to_purge: None, - } - } - #[doc = "Diagnose workspace setup issue."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn diagnose( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> diagnose::RequestBuilder { - diagnose::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - body: None, - } - } - #[doc = "Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Get Azure Machine Learning Workspace notebook access token"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_notebook_access_token( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_notebook_access_token::RequestBuilder { - list_notebook_access_token::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Lists keys of Azure Machine Learning Workspaces notebook."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_notebook_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_notebook_keys::RequestBuilder { - list_notebook_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Lists keys of Azure Machine Learning Workspace's storage account."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_storage_account_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_storage_account_keys::RequestBuilder { - list_storage_account_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list_outbound_network_dependencies_endpoints( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list_outbound_network_dependencies_endpoints::RequestBuilder { - list_outbound_network_dependencies_endpoints::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Prepare Azure Machine Learning Workspace's notebook resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn prepare_notebook( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> prepare_notebook::RequestBuilder { - prepare_notebook::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn resync_keys( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> resync_keys::RequestBuilder { - resync_keys::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - } - pub mod list_by_subscription { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) skip: Option, - pub(crate) kind: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Kind of workspace."] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.MachineLearningServices/workspaces", - self.client.endpoint(), - &self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list_by_resource_group { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) skip: Option, - pub(crate) kind: Option, - } - impl RequestBuilder { - #[doc = "Continuation token for pagination."] - pub fn skip(mut self, skip: impl Into) -> Self { - self.skip = Some(skip.into()); - self - } - #[doc = "Kind of workspace."] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", skip); - } - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Workspace = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Workspace = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) body: models::Workspace, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Workspace = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) body: models::WorkspaceUpdateParameters, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{body_content::get_provisioning_state, get_retry_after, LroStatus}, - sleep::sleep, - }; - use std::time::Duration; - loop { - let this = self.clone(); - let response = this.send().await?; - let retry_after = get_retry_after(response.as_raw_response().headers()); - let status = response.as_raw_response().status(); - let body = response.into_body().await?; - let provisioning_state = get_provisioning_state(status, &body)?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => return Ok(body), - LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) force_to_purge: Option, - } - impl RequestBuilder { - #[doc = "Flag to indicate delete is a purge request."] - pub fn force_to_purge(mut self, force_to_purge: bool) -> Self { - self.force_to_purge = Some(force_to_purge); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - if let Some(force_to_purge) = &this.force_to_purge { - req.url_mut() - .query_pairs_mut() - .append_pair("forceToPurge", &force_to_purge.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod diagnose { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DiagnoseResponseResult = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) body: Option, - } - impl RequestBuilder { - #[doc = "The parameter of diagnosing workspace health"] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/diagnose", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod list_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListWorkspaceKeysResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_notebook_access_token { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NotebookAccessTokenResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookAccessToken" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_notebook_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListNotebookKeysResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listNotebookKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_storage_account_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ListStorageAccountKeysResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/listStorageAccountKeys" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_outbound_network_dependencies_endpoints { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExternalFqdnResponse = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundNetworkDependenciesEndpoints" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod prepare_notebook { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NotebookResourceInfo = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/prepareNotebook", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod resync_keys { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/resyncKeys", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod workspace_connections { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all the available machine learning workspaces connections under the specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - target: None, - category: None, - } - } - #[doc = "Lists machine learning workspaces connections by name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - } - } - #[doc = "Create or update machine learning workspaces connections under the specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - body: None, - } - } - #[doc = "Update machine learning workspaces connections under the specified workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - body: None, - } - } - #[doc = "Delete machine learning workspaces connections by name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - } - } - #[doc = "List all the secrets of a machine learning workspaces connections."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `connection_name`: Friendly name of the workspace connection"] - pub fn list_secrets( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - connection_name: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - connection_name: connection_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) target: Option, - pub(crate) category: Option, - } - impl RequestBuilder { - #[doc = "Target of the workspace connection."] - pub fn target(mut self, target: impl Into) -> Self { - self.target = Some(target.into()); - self - } - #[doc = "Category of the workspace connection."] - pub fn category(mut self, category: impl Into) -> Self { - self.category = Some(category.into()); - self - } - pub fn into_stream( - self, - ) -> azure_core::Pageable - { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - if let Some(target) = &this.target { - req.url_mut().query_pairs_mut().append_pair("target", target); - } - if let Some(category) = &this.category { - req.url_mut().query_pairs_mut().append_pair("category", category); - } - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.connection_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - pub(crate) body: Option, - } - impl RequestBuilder { - #[doc = "The object for creating or updating a new workspace connection"] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.connection_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - pub(crate) body: Option, - } - impl RequestBuilder { - #[doc = "Parameters for workspace connection update."] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.connection_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.connection_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod list_secrets { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkspaceConnectionPropertiesV2BasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - 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?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/connections/{}/listsecrets" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . connection_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod managed_network_settings_rule { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the managed network outbound rules for a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Gets an outbound rule from the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `rule_name`: Name of the workspace managed network outbound rule"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - rule_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - rule_name: rule_name.into(), - } - } - #[doc = "Creates or updates an outbound rule in the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `rule_name`: Name of the workspace managed network outbound rule"] - #[doc = "* `body`: Outbound Rule to be created or updated in the managed network of a machine learning workspace."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - rule_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - rule_name: rule_name.into(), - body: body.into(), - } - } - #[doc = "Deletes an outbound rule from the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `rule_name`: Name of the workspace managed network outbound rule"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - rule_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - rule_name: rule_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OutboundRuleListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = this.url()?; - 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, "2023-06-01-preview"); - } - 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()), - ); - 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) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OutboundRuleBasicResource = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) rule_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.rule_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OutboundRuleBasicResource = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) rule_name: String, - pub(crate) body: models::OutboundRuleBasicResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.rule_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) rule_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/outboundRules/{}", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name, - &self.rule_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod private_endpoint_connections { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Called by end-users to get all PE connections."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Called by end-users to get a PE connection."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `private_endpoint_connection_name`: NRP Private Endpoint Connection Name"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - private_endpoint_connection_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - } - } - #[doc = "Called by end-users to approve or reject a PE connection.\r\nThis method must validate and forward the call to NRP."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `private_endpoint_connection_name`: NRP Private Endpoint Connection Name"] - #[doc = "* `body`: PrivateEndpointConnection object"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - private_endpoint_connection_name: impl Into, - body: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - body: body.into(), - } - } - #[doc = "Called by end-users to delete a PE connection."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - #[doc = "* `private_endpoint_connection_name`: NRP Private Endpoint Connection Name"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - private_endpoint_connection_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnectionListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] - #[doc = ""] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } - pub mod get { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnection = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) private_endpoint_connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnection = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) private_endpoint_connection_name: String, - pub(crate) body: models::PrivateEndpointConnection, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) private_endpoint_connection_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateEndpointConnections/{}" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name , & self . private_endpoint_connection_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod private_link_resources { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Called by Client (Portal, CLI, etc) to get available \"private link resources\" for the workspace.\r\nEach \"private link resource\" is a connection endpoint (IP address) to the resource.\r\nPre single connection endpoint per workspace: the Data Plane IP address, returned by DNS resolution.\r\nOther RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc.\r\nDefined in the \"[NRP] Private Endpoint Design\" doc, topic \"GET API for GroupIds\"."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - } - pub mod list { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateLinkResourceListResult = 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 for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the [`RequestBuilder`] into a future"] - #[doc = r" executes the request and returns a `Result` with the parsed"] - #[doc = r" response."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use `.send().await` instead."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details"] - #[doc = r" (e.g. to inspect response headers or raw body data) then you"] - #[doc = r" can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future"] - #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - #[doc = "Only the first response will be fetched as the continuation token is not part of the response schema"] - #[doc = ""] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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 req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/privateLinkResources", - self.client.endpoint(), - &self.subscription_id, - &self.resource_group_name, - &self.workspace_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - } -} -pub mod managed_network_provisions { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provisions the managed network of a machine learning workspace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: Name of Azure Machine Learning workspace."] - pub fn provision_managed_network( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> provision_managed_network::RequestBuilder { - provision_managed_network::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - body: None, - } - } - } - pub mod provision_managed_network { - use super::models; - #[cfg(not(target_arch = "wasm32"))] - use futures::future::BoxFuture; - #[cfg(target_arch = "wasm32")] - use futures::future::LocalBoxFuture as BoxFuture; - #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ManagedNetworkProvisionStatus = 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 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "URI to poll for asynchronous operation result."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "Duration the client should wait between requests, in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" This `RequestBuilder` implements a Long Running Operation"] - #[doc = r" (LRO)."] - #[doc = r""] - #[doc = r" To finalize and submit the request, invoke `.await`, which"] - #[doc = r" which will convert the `RequestBuilder` into a future"] - #[doc = r" executes the request and polls the service until the"] - #[doc = r" operation completes."] - #[doc = r""] - #[doc = r" In order to execute the request without polling the service"] - #[doc = r" until the operation completes, use"] - #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) body: Option, - } - impl RequestBuilder { - #[doc = "Managed Network Provisioning Options for a machine learning workspace."] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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()), - ); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - fn url(&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{}/provisionManagedNetwork" , self . client . endpoint () , & self . subscription_id , & self . resource_group_name , & self . workspace_name)) ? ; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); - } - Ok(url) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that polls the long running operation, returning once the operation completes."] - #[doc = ""] - #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - use azure_core::{ - error::{Error, ErrorKind}, - lro::{ - get_retry_after, - location::{get_location, get_provisioning_state, FinalState}, - LroStatus, - }, - sleep::sleep, - }; - use std::time::Duration; - let this = self.clone(); - let response = this.send().await?; - let headers = response.as_raw_response().headers(); - let location = get_location(headers, FinalState::Location)?; - if let Some(url) = location { - loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - let headers = response.headers(); - let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; - let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| { - Error::message( - ErrorKind::Other, - "Long running operation failed (missing provisioning state)".to_string(), - ) - })?; - log::trace!("current provisioning_state: {provisioning_state:?}"); - match provisioning_state { - LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); - let credential = self.client.token_credential(); - let token_response = credential.get_token(&self.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let response = self.client.send(&mut req).await?; - return Response(response).into_body().await; - } - LroStatus::Failed => { - return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())) - } - LroStatus::Canceled => { - return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())) - } - _ => { - sleep(retry_after).await; - } - } - } - } else { - response.into_body().await - } - }) - } - } - } -} diff --git a/services/mgmt/machinelearningservices/src/package_preview_2023_06/models.rs b/services/mgmt/machinelearningservices/src/package_preview_2023_06/models.rs deleted file mode 100644 index 097c0caab3..0000000000 --- a/services/mgmt/machinelearningservices/src/package_preview_2023_06/models.rs +++ /dev/null @@ -1,20156 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "A Machine Learning compute based on AKS."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Aks { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub aks_schema: AksSchema, -} -impl Aks { - pub fn new(compute: Compute) -> Self { - Self { - compute, - aks_schema: AksSchema::default(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AksSchema { - #[doc = "AKS properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl AksSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod aks_schema { - use super::*; - #[doc = "AKS properties"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Cluster full qualified domain name"] - #[serde(rename = "clusterFqdn", default, skip_serializing_if = "Option::is_none")] - pub cluster_fqdn: Option, - #[doc = "System services"] - #[serde( - rename = "systemServices", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub system_services: Vec, - #[doc = "Number of agents"] - #[serde(rename = "agentCount", default, skip_serializing_if = "Option::is_none")] - pub agent_count: Option, - #[doc = "Agent virtual machine size"] - #[serde(rename = "agentVmSize", default, skip_serializing_if = "Option::is_none")] - pub agent_vm_size: Option, - #[doc = "Intended usage of the cluster"] - #[serde(rename = "clusterPurpose", default, skip_serializing_if = "Option::is_none")] - pub cluster_purpose: Option, - #[doc = "The ssl configuration for scoring"] - #[serde(rename = "sslConfiguration", default, skip_serializing_if = "Option::is_none")] - pub ssl_configuration: Option, - #[doc = "Advance configuration for AKS networking"] - #[serde(rename = "aksNetworkingConfiguration", default, skip_serializing_if = "Option::is_none")] - pub aks_networking_configuration: Option, - #[doc = "Load Balancer Type"] - #[serde(rename = "loadBalancerType", default, skip_serializing_if = "Option::is_none")] - pub load_balancer_type: Option, - #[doc = "Load Balancer Subnet"] - #[serde(rename = "loadBalancerSubnet", default, skip_serializing_if = "Option::is_none")] - pub load_balancer_subnet: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } - pub mod properties { - use super::*; - #[doc = "Intended usage of the cluster"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ClusterPurpose")] - pub enum ClusterPurpose { - FastProd, - DenseProd, - DevTest, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ClusterPurpose { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ClusterPurpose { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ClusterPurpose { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::FastProd => serializer.serialize_unit_variant("ClusterPurpose", 0u32, "FastProd"), - Self::DenseProd => serializer.serialize_unit_variant("ClusterPurpose", 1u32, "DenseProd"), - Self::DevTest => serializer.serialize_unit_variant("ClusterPurpose", 2u32, "DevTest"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for ClusterPurpose { - fn default() -> Self { - Self::FastProd - } - } - #[doc = "Load Balancer Type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LoadBalancerType")] - pub enum LoadBalancerType { - PublicIp, - InternalLoadBalancer, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LoadBalancerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LoadBalancerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LoadBalancerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::PublicIp => serializer.serialize_unit_variant("LoadBalancerType", 0u32, "PublicIp"), - Self::InternalLoadBalancer => serializer.serialize_unit_variant("LoadBalancerType", 1u32, "InternalLoadBalancer"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for LoadBalancerType { - fn default() -> Self { - Self::PublicIp - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccessKeyAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl AccessKeyAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Account key datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccountKeyDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Datastore account key secrets."] - pub secrets: AccountKeyDatastoreSecrets, -} -impl AccountKeyDatastoreCredentials { - pub fn new(datastore_credentials: DatastoreCredentials, secrets: AccountKeyDatastoreSecrets) -> Self { - Self { - datastore_credentials, - secrets, - } - } -} -#[doc = "Datastore account key secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AccountKeyDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Storage account key."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option, -} -impl AccountKeyDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - key: None, - } - } -} -#[doc = "Details of ACR account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AcrDetails { - #[serde(rename = "systemCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_acr_account: Option, - #[serde(rename = "userCreatedAcrAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_acr_account: Option, -} -impl AcrDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Secrets related to a Machine Learning compute based on AKS."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AksComputeSecrets { - #[serde(flatten)] - pub compute_secrets: ComputeSecrets, - #[serde(flatten)] - pub aks_compute_secrets_properties: AksComputeSecretsProperties, -} -impl AksComputeSecrets { - pub fn new(compute_secrets: ComputeSecrets) -> Self { - Self { - compute_secrets, - aks_compute_secrets_properties: AksComputeSecretsProperties::default(), - } - } -} -#[doc = "Properties of AksComputeSecrets"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AksComputeSecretsProperties { - #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] - #[serde(rename = "userKubeConfig", default, skip_serializing_if = "Option::is_none")] - pub user_kube_config: Option, - #[doc = "Content of kubeconfig file that can be used to connect to the Kubernetes cluster."] - #[serde(rename = "adminKubeConfig", default, skip_serializing_if = "Option::is_none")] - pub admin_kube_config: Option, - #[doc = "Image registry pull secret."] - #[serde(rename = "imagePullSecretName", default, skip_serializing_if = "Option::is_none")] - pub image_pull_secret_name: Option, -} -impl AksComputeSecretsProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Advance configuration for AKS networking"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AksNetworkingConfiguration { - #[doc = "Virtual network subnet resource ID the compute nodes belong to"] - #[serde(rename = "subnetId", default, skip_serializing_if = "Option::is_none")] - pub subnet_id: Option, - #[doc = "A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges."] - #[serde(rename = "serviceCidr", default, skip_serializing_if = "Option::is_none")] - pub service_cidr: Option, - #[doc = "An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr."] - #[serde(rename = "dnsServiceIP", default, skip_serializing_if = "Option::is_none")] - pub dns_service_ip: Option, - #[doc = "A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range."] - #[serde(rename = "dockerBridgeCidr", default, skip_serializing_if = "Option::is_none")] - pub docker_bridge_cidr: Option, -} -impl AksNetworkingConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AllFeatures { - #[serde(flatten)] - pub monitoring_feature_filter_base: MonitoringFeatureFilterBase, -} -impl AllFeatures { - pub fn new(monitoring_feature_filter_base: MonitoringFeatureFilterBase) -> Self { - Self { - monitoring_feature_filter_base, - } - } -} -#[doc = "All nodes means the service will be running on all of the nodes of the job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AllNodes { - #[serde(flatten)] - pub nodes: Nodes, -} -impl AllNodes { - pub fn new(nodes: Nodes) -> Self { - Self { nodes } - } -} -#[doc = "An Azure Machine Learning compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AmlCompute { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub aml_compute_schema: AmlComputeSchema, -} -impl AmlCompute { - pub fn new(compute: Compute) -> Self { - Self { - compute, - aml_compute_schema: AmlComputeSchema::default(), - } - } -} -#[doc = "Compute node information related to a AmlCompute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeNodeInformation { - #[doc = "ID of the compute node."] - #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")] - pub node_id: Option, - #[doc = "Private IP address of the compute node."] - #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] - pub private_ip_address: Option, - #[doc = "Public IP address of the compute node."] - #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] - pub public_ip_address: Option, - #[doc = "SSH port number of the node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] - #[serde(rename = "nodeState", default, skip_serializing_if = "Option::is_none")] - pub node_state: Option, - #[doc = "ID of the Experiment running on the node, if any else null."] - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option, -} -impl AmlComputeNodeInformation { - pub fn new() -> Self { - Self::default() - } -} -pub mod aml_compute_node_information { - use super::*; - #[doc = "State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "NodeState")] - pub enum NodeState { - #[serde(rename = "idle")] - Idle, - #[serde(rename = "running")] - Running, - #[serde(rename = "preparing")] - Preparing, - #[serde(rename = "unusable")] - Unusable, - #[serde(rename = "leaving")] - Leaving, - #[serde(rename = "preempted")] - Preempted, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for NodeState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for NodeState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for NodeState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Idle => serializer.serialize_unit_variant("NodeState", 0u32, "idle"), - Self::Running => serializer.serialize_unit_variant("NodeState", 1u32, "running"), - Self::Preparing => serializer.serialize_unit_variant("NodeState", 2u32, "preparing"), - Self::Unusable => serializer.serialize_unit_variant("NodeState", 3u32, "unusable"), - Self::Leaving => serializer.serialize_unit_variant("NodeState", 4u32, "leaving"), - Self::Preempted => serializer.serialize_unit_variant("NodeState", 5u32, "preempted"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Result of AmlCompute Nodes"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeNodesInformation { - #[doc = "The collection of returned AmlCompute nodes details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub nodes: Vec, - #[doc = "The continuation token."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for AmlComputeNodesInformation { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl AmlComputeNodesInformation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AML Compute properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeProperties { - #[doc = "Compute OS Type"] - #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] - pub os_type: Option, - #[doc = "Virtual Machine Size"] - #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] - pub vm_size: Option, - #[doc = "Virtual Machine priority"] - #[serde(rename = "vmPriority", default, skip_serializing_if = "Option::is_none")] - pub vm_priority: Option, - #[doc = "Virtual Machine image for Windows AML Compute"] - #[serde(rename = "virtualMachineImage", default, skip_serializing_if = "Option::is_none")] - pub virtual_machine_image: Option, - #[doc = "Network is isolated or not"] - #[serde(rename = "isolatedNetwork", default, skip_serializing_if = "Option::is_none")] - pub isolated_network: Option, - #[doc = "scale settings for AML Compute"] - #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, - #[doc = "Settings for user account that gets created on each on the nodes of a compute."] - #[serde(rename = "userAccountCredentials", default, skip_serializing_if = "Option::is_none")] - pub user_account_credentials: Option, - #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subnet: Option, - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] - #[serde(rename = "remoteLoginPortPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub remote_login_port_public_access: Option, - #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] - #[serde(rename = "allocationState", default, skip_serializing_if = "Option::is_none")] - pub allocation_state: Option, - #[doc = "The time at which the compute entered its current allocation state."] - #[serde(rename = "allocationStateTransitionTime", default, with = "azure_core::date::rfc3339::option")] - pub allocation_state_transition_time: Option, - #[doc = "Collection of errors encountered by various compute nodes during node setup."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub errors: Vec, - #[doc = "The number of compute nodes currently assigned to the compute."] - #[serde(rename = "currentNodeCount", default, skip_serializing_if = "Option::is_none")] - pub current_node_count: Option, - #[doc = "The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation."] - #[serde(rename = "targetNodeCount", default, skip_serializing_if = "Option::is_none")] - pub target_node_count: Option, - #[doc = "Counts of various compute node states on the amlCompute."] - #[serde(rename = "nodeStateCounts", default, skip_serializing_if = "Option::is_none")] - pub node_state_counts: Option, - #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] - #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] - pub enable_node_public_ip: Option, - #[doc = "A property bag containing additional properties."] - #[serde(rename = "propertyBag", default, skip_serializing_if = "Option::is_none")] - pub property_bag: Option, -} -impl AmlComputeProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod aml_compute_properties { - use super::*; - #[doc = "Compute OS Type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OsType")] - pub enum OsType { - Linux, - Windows, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), - Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for OsType { - fn default() -> Self { - Self::Linux - } - } - #[doc = "Virtual Machine priority"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "VmPriority")] - pub enum VmPriority { - Dedicated, - LowPriority, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for VmPriority { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for VmPriority { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for VmPriority { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dedicated => serializer.serialize_unit_variant("VmPriority", 0u32, "Dedicated"), - Self::LowPriority => serializer.serialize_unit_variant("VmPriority", 1u32, "LowPriority"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "RemoteLoginPortPublicAccess")] - pub enum RemoteLoginPortPublicAccess { - Enabled, - Disabled, - NotSpecified, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for RemoteLoginPortPublicAccess { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for RemoteLoginPortPublicAccess { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for RemoteLoginPortPublicAccess { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 1u32, "Disabled"), - Self::NotSpecified => serializer.serialize_unit_variant("RemoteLoginPortPublicAccess", 2u32, "NotSpecified"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for RemoteLoginPortPublicAccess { - fn default() -> Self { - Self::NotSpecified - } - } - #[doc = "Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "AllocationState")] - pub enum AllocationState { - Steady, - Resizing, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for AllocationState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for AllocationState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for AllocationState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Steady => serializer.serialize_unit_variant("AllocationState", 0u32, "Steady"), - Self::Resizing => serializer.serialize_unit_variant("AllocationState", 1u32, "Resizing"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Properties(top level) of AmlCompute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlComputeSchema { - #[doc = "AML Compute properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl AmlComputeSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Machine Learning team account REST API operation"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlOperation { - #[doc = "Display name of operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, - #[doc = "Indicates whether the operation applies to data-plane"] - #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] - pub is_data_action: Option, - #[doc = "Gets or sets operation name: {provider}/{resource}/{operation}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The intended executor of the operation: user/system"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option, -} -impl AmlOperation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An array of operations supported by the resource provider."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlOperationListResult { - #[doc = "Gets or sets list of AML team account operations supported by the\r\nAML team account resource provider."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for AmlOperationListResult { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl AmlOperationListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AML Token identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AmlToken { - #[serde(flatten)] - pub identity_configuration: IdentityConfiguration, -} -impl AmlToken { - pub fn new(identity_configuration: IdentityConfiguration) -> Self { - Self { identity_configuration } - } -} -#[doc = "AML token compute identity definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AmlTokenComputeIdentity { - #[serde(flatten)] - pub monitor_compute_identity_base: MonitorComputeIdentityBase, -} -impl AmlTokenComputeIdentity { - pub fn new(monitor_compute_identity_base: MonitorComputeIdentityBase) -> Self { - Self { - monitor_compute_identity_base, - } - } -} -#[doc = "Features enabled for a workspace"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AmlUserFeature { - #[doc = "Specifies the feature ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Specifies the feature name "] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Describes the feature for user experience"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl AmlUserFeature { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "This connection type covers the generic ApiKey auth connection categories, for examples:\r\nAzureOpenAI:\r\n Category:= AzureOpenAI\r\n AuthType:= ApiKey (as type discriminator)\r\n Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey\r\n Target:= {ApiBase}\r\n \r\nCognitiveService:\r\n Category:= CognitiveService\r\n AuthType:= ApiKey (as type discriminator)\r\n Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey\r\n Target:= ServiceRegion={serviceRegion}\r\n \r\nCognitiveSearch:\r\n Category:= CognitiveSearch\r\n AuthType:= ApiKey (as type discriminator)\r\n Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey\r\n Target:= {Endpoint}\r\n \r\nUse Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiKeyAuthWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[doc = "Api key object for workspace connection credential."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ApiKeyAuthWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "ARM ResourceId of a resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArmResourceId { - #[doc = "Arm ResourceId is in the format \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}\"\r\nor \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}\""] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl ArmResourceId { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AssetBase { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[serde(rename = "autoDeleteSetting", default, skip_serializing_if = "Option::is_none")] - pub auto_delete_setting: Option, - #[doc = "If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous"] - #[serde(rename = "isAnonymous", default, skip_serializing_if = "Option::is_none")] - pub is_anonymous: Option, - #[doc = "Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived"] - #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] - pub is_archived: Option, -} -impl AssetBase { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AssetContainer { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "Is the asset archived?"] - #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] - pub is_archived: Option, - #[doc = "The latest version inside this container."] - #[serde(rename = "latestVersion", default, skip_serializing_if = "Option::is_none")] - pub latest_version: Option, - #[doc = "The next auto incremental version"] - #[serde(rename = "nextVersion", default, skip_serializing_if = "Option::is_none")] - pub next_version: Option, -} -impl AssetContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Asset input type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssetJobInput { - #[doc = "Enum to determine the input data delivery mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "[Required] Input Asset URI."] - pub uri: String, -} -impl AssetJobInput { - pub fn new(uri: String) -> Self { - Self { mode: None, uri } - } -} -#[doc = "Asset output type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AssetJobOutput { - #[doc = "Output Asset Name."] - #[serde(rename = "assetName", default, skip_serializing_if = "Option::is_none")] - pub asset_name: Option, - #[doc = "Output Asset Version."] - #[serde(rename = "assetVersion", default, skip_serializing_if = "Option::is_none")] - pub asset_version: Option, - #[serde(rename = "autoDeleteSetting", default, skip_serializing_if = "Option::is_none")] - pub auto_delete_setting: Option, - #[doc = "Output data delivery mode enums."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Output Asset URI."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, -} -impl AssetJobOutput { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Provisioning state of registry asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AssetProvisioningState")] -pub enum AssetProvisioningState { - Succeeded, - Failed, - Canceled, - Creating, - Updating, - Deleting, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AssetProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AssetProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AssetProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("AssetProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("AssetProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("AssetProvisioningState", 2u32, "Canceled"), - Self::Creating => serializer.serialize_unit_variant("AssetProvisioningState", 3u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("AssetProvisioningState", 4u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("AssetProvisioningState", 5u32, "Deleting"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition for asset references."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssetReferenceBase { - #[doc = "Enum to determine which reference method to use for an asset."] - #[serde(rename = "referenceType")] - pub reference_type: ReferenceType, -} -impl AssetReferenceBase { - pub fn new(reference_type: ReferenceType) -> Self { - Self { reference_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "referenceType")] -pub enum AssetReferenceBaseUnion { - DataPath(DataPathAssetReference), - Id(IdAssetReference), - OutputPath(OutputPathAssetReference), -} -#[doc = "A user that can be assigned to a compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssignedUser { - #[doc = "User’s AAD Object Id."] - #[serde(rename = "objectId")] - pub object_id: String, - #[doc = "User’s AAD Tenant Id."] - #[serde(rename = "tenantId")] - pub tenant_id: String, -} -impl AssignedUser { - pub fn new(object_id: String, tenant_id: String) -> Self { - Self { object_id, tenant_id } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AutoDeleteCondition")] -pub enum AutoDeleteCondition { - CreatedGreaterThan, - LastAccessedGreaterThan, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AutoDeleteCondition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AutoDeleteCondition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AutoDeleteCondition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreatedGreaterThan => serializer.serialize_unit_variant("AutoDeleteCondition", 0u32, "CreatedGreaterThan"), - Self::LastAccessedGreaterThan => serializer.serialize_unit_variant("AutoDeleteCondition", 1u32, "LastAccessedGreaterThan"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AutoDeleteSetting { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option, - #[doc = "Expiration condition value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl AutoDeleteSetting { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecast horizon determined automatically by system."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoForecastHorizon { - #[serde(flatten)] - pub forecast_horizon: ForecastHorizon, -} -impl AutoForecastHorizon { - pub fn new(forecast_horizon: ForecastHorizon) -> Self { - Self { forecast_horizon } - } -} -#[doc = "AutoMLJob class.\r\nUse this class for executing AutoML tasks like Classification/Regression etc.\r\nSee TaskType enum for all the tasks supported."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoMlJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "The ARM resource ID of the Environment specification for the job.\r\nThis is optional value to provide, if not provided, AutoML will default this to Production AutoML curated environment version when running the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Environment variables included in the job."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, - #[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] - #[serde(rename = "taskDetails")] - pub task_details: AutoMlVerticalUnion, -} -impl AutoMlJob { - pub fn new(job_base: JobBase, task_details: AutoMlVerticalUnion) -> Self { - Self { - job_base, - environment_id: None, - environment_variables: None, - outputs: None, - queue_settings: None, - resources: None, - task_details, - } - } -} -#[doc = "AutoML vertical class.\r\nBase class for AutoML verticals - TableVertical/ImageVertical/NLPVertical"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoMlVertical { - #[doc = "Enum for setting log verbosity."] - #[serde(rename = "logVerbosity", default, skip_serializing_if = "Option::is_none")] - pub log_verbosity: Option, - #[doc = "Target column name: This is prediction values column.\r\nAlso known as label column name in context of classification tasks."] - #[serde(rename = "targetColumnName", default, skip_serializing_if = "Option::is_none")] - pub target_column_name: Option, - #[doc = "AutoMLJob Task type."] - #[serde(rename = "taskType")] - pub task_type: TaskType, - #[serde(rename = "trainingData")] - pub training_data: MlTableJobInput, -} -impl AutoMlVertical { - pub fn new(task_type: TaskType, training_data: MlTableJobInput) -> Self { - Self { - log_verbosity: None, - target_column_name: None, - task_type, - training_data, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "taskType")] -pub enum AutoMlVerticalUnion { - Classification(Classification), - Forecasting(Forecasting), - ImageClassification(ImageClassification), - ImageClassificationMultilabel(ImageClassificationMultilabel), - ImageInstanceSegmentation(ImageInstanceSegmentation), - ImageObjectDetection(ImageObjectDetection), - Regression(Regression), - TextClassification(TextClassification), - TextClassificationMultilabel(TextClassificationMultilabel), - #[serde(rename = "TextNER")] - TextNer(TextNer), -} -#[doc = "N-Cross validations determined automatically."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoNCrossValidations { - #[serde(flatten)] - pub n_cross_validations: NCrossValidations, -} -impl AutoNCrossValidations { - pub fn new(n_cross_validations: NCrossValidations) -> Self { - Self { n_cross_validations } - } -} -#[doc = "Auto pause properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AutoPauseProperties { - #[serde(rename = "delayInMinutes", default, skip_serializing_if = "Option::is_none")] - pub delay_in_minutes: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} -impl AutoPauseProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AutoRebuild setting for the derived image"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "AutoRebuildSetting")] -pub enum AutoRebuildSetting { - Disabled, - OnBaseImageUpdate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for AutoRebuildSetting { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for AutoRebuildSetting { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for AutoRebuildSetting { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("AutoRebuildSetting", 0u32, "Disabled"), - Self::OnBaseImageUpdate => serializer.serialize_unit_variant("AutoRebuildSetting", 1u32, "OnBaseImageUpdate"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Auto scale properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AutoScaleProperties { - #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] - pub min_node_count: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "maxNodeCount", default, skip_serializing_if = "Option::is_none")] - pub max_node_count: Option, -} -impl AutoScaleProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoSeasonality { - #[serde(flatten)] - pub seasonality: Seasonality, -} -impl AutoSeasonality { - pub fn new(seasonality: Seasonality) -> Self { - Self { seasonality } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoTargetLags { - #[serde(flatten)] - pub target_lags: TargetLags, -} -impl AutoTargetLags { - pub fn new(target_lags: TargetLags) -> Self { - Self { target_lags } - } -} -#[doc = "Target lags rolling window determined automatically."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutoTargetRollingWindowSize { - #[serde(flatten)] - pub target_rolling_window_size: TargetRollingWindowSize, -} -impl AutoTargetRollingWindowSize { - pub fn new(target_rolling_window_size: TargetRollingWindowSize) -> Self { - Self { - target_rolling_window_size, - } - } -} -#[doc = "Settings for Autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AutologgerSettings { - #[doc = "Enum to determine the state of mlflow autologger."] - #[serde(rename = "mlflowAutologger")] - pub mlflow_autologger: MlFlowAutologgerState, -} -impl AutologgerSettings { - pub fn new(mlflow_autologger: MlFlowAutologgerState) -> Self { - Self { mlflow_autologger } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzMonMonitoringAlertNotificationSettings { - #[serde(flatten)] - pub monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase, -} -impl AzMonMonitoringAlertNotificationSettings { - pub fn new(monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase) -> Self { - Self { - monitoring_alert_notification_settings_base, - } - } -} -#[doc = "Azure Blob datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureBlobDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "Storage account name."] - #[serde(rename = "accountName", default, skip_serializing_if = "Option::is_none")] - pub account_name: Option, - #[doc = "Storage account container name."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "Azure cloud endpoint for the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "Protocol used to communicate with the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl AzureBlobDatastore { - pub fn new(datastore: Datastore) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - account_name: None, - container_name: None, - endpoint: None, - protocol: None, - service_data_access_auth_identity: None, - } - } -} -#[doc = "Azure Data Lake Gen1 datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDataLakeGen1Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, - #[doc = "[Required] Azure Data Lake store name."] - #[serde(rename = "storeName")] - pub store_name: String, -} -impl AzureDataLakeGen1Datastore { - pub fn new(datastore: Datastore, store_name: String) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - service_data_access_auth_identity: None, - store_name, - } - } -} -#[doc = "Azure Data Lake Gen2 datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDataLakeGen2Datastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "[Required] Storage account name."] - #[serde(rename = "accountName")] - pub account_name: String, - #[doc = "Azure cloud endpoint for the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "[Required] The name of the Data Lake Gen2 filesystem."] - pub filesystem: String, - #[doc = "Protocol used to communicate with the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl AzureDataLakeGen2Datastore { - pub fn new(datastore: Datastore, account_name: String, filesystem: String) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - account_name, - endpoint: None, - filesystem, - protocol: None, - service_data_access_auth_identity: None, - } - } -} -#[doc = "Base definition for Azure datastore contents configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureDatastore { - #[doc = "Azure Resource Group name"] - #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] - pub resource_group: Option, - #[doc = "Azure Subscription Id"] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, -} -impl AzureDatastore { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Webhook details specific for Azure DevOps"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDevOpsWebhook { - #[serde(flatten)] - pub webhook: Webhook, -} -impl AzureDevOpsWebhook { - pub fn new(webhook: Webhook) -> Self { - Self { webhook } - } -} -#[doc = "Azure File datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureFileDatastore { - #[serde(flatten)] - pub azure_datastore: AzureDatastore, - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "[Required] Storage account name."] - #[serde(rename = "accountName")] - pub account_name: String, - #[doc = "Azure cloud endpoint for the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "[Required] The name of the Azure file share that the datastore points to."] - #[serde(rename = "fileShareName")] - pub file_share_name: String, - #[doc = "Protocol used to communicate with the storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl AzureFileDatastore { - pub fn new(datastore: Datastore, account_name: String, file_share_name: String) -> Self { - Self { - azure_datastore: AzureDatastore::default(), - datastore, - account_name, - endpoint: None, - file_share_name, - protocol: None, - service_data_access_auth_identity: None, - } - } -} -#[doc = "Azure ML batch inferencing server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureMlBatchInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, -} -impl AzureMlBatchInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - code_configuration: None, - } - } -} -#[doc = "Azure ML online inferencing configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureMlOnlineInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, -} -impl AzureMlOnlineInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - code_configuration: None, - } - } -} -#[doc = "Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BanditPolicy { - #[serde(flatten)] - pub early_termination_policy: EarlyTerminationPolicy, - #[doc = "Absolute distance allowed from the best performing run."] - #[serde(rename = "slackAmount", default, skip_serializing_if = "Option::is_none")] - pub slack_amount: Option, - #[doc = "Ratio of the allowed distance from the best performing run."] - #[serde(rename = "slackFactor", default, skip_serializing_if = "Option::is_none")] - pub slack_factor: Option, -} -impl BanditPolicy { - pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { - Self { - early_termination_policy, - slack_amount: None, - slack_factor: None, - } - } -} -#[doc = "Base environment type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BaseEnvironmentId { - #[serde(flatten)] - pub base_environment_source: BaseEnvironmentSource, - #[doc = "[Required] Resource id accepting ArmId or AzureMlId."] - #[serde(rename = "resourceId")] - pub resource_id: String, -} -impl BaseEnvironmentId { - pub fn new(base_environment_source: BaseEnvironmentSource, resource_id: String) -> Self { - Self { - base_environment_source, - resource_id, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BaseEnvironmentSource { - #[doc = "Base environment type."] - #[serde(rename = "baseEnvironmentSourceType")] - pub base_environment_source_type: BaseEnvironmentSourceType, -} -impl BaseEnvironmentSource { - pub fn new(base_environment_source_type: BaseEnvironmentSourceType) -> Self { - Self { - base_environment_source_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "baseEnvironmentSourceType")] -pub enum BaseEnvironmentSourceUnion { - EnvironmentAsset(BaseEnvironmentId), -} -#[doc = "Base environment type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BaseEnvironmentSourceType")] -pub enum BaseEnvironmentSourceType { - EnvironmentAsset, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BaseEnvironmentSourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BaseEnvironmentSourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BaseEnvironmentSourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::EnvironmentAsset => serializer.serialize_unit_variant("BaseEnvironmentSourceType", 0u32, "EnvironmentAsset"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Batch inference settings per deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchDeployment { - #[serde(flatten)] - pub endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase, - #[doc = "Compute target for batch inference operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compute: Option, - #[doc = "Properties relevant to different deployment types."] - #[serde(rename = "deploymentConfiguration", default, skip_serializing_if = "Option::is_none")] - pub deployment_configuration: Option, - #[doc = "Error threshold, if the error count for the entire input goes above this value,\r\nthe batch inference will be aborted. Range is [-1, int.MaxValue].\r\nFor FileDataset, this value is the count of file failures.\r\nFor TabularDataset, this value is the count of record failures.\r\nIf set to -1 (the lower bound), all failures during batch inference will be ignored."] - #[serde(rename = "errorThreshold", default, skip_serializing_if = "Option::is_none")] - pub error_threshold: Option, - #[doc = "Log verbosity for batch inferencing.\r\nIncreasing verbosity order for logging is : Warning, Info and Debug.\r\nThe default value is Info."] - #[serde(rename = "loggingLevel", default, skip_serializing_if = "Option::is_none")] - pub logging_level: Option, - #[doc = "Indicates maximum number of parallelism per instance."] - #[serde(rename = "maxConcurrencyPerInstance", default, skip_serializing_if = "Option::is_none")] - pub max_concurrency_per_instance: Option, - #[doc = "Size of the mini-batch passed to each batch invocation.\r\nFor FileDataset, this is the number of files per mini-batch.\r\nFor TabularDataset, this is the size of the records in bytes, per mini-batch."] - #[serde(rename = "miniBatchSize", default, skip_serializing_if = "Option::is_none")] - pub mini_batch_size: Option, - #[doc = "Base definition for asset references."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, - #[doc = "Enum to determine how batch inferencing will handle output"] - #[serde(rename = "outputAction", default, skip_serializing_if = "Option::is_none")] - pub output_action: Option, - #[doc = "Customized output file name for append_row output action."] - #[serde(rename = "outputFileName", default, skip_serializing_if = "Option::is_none")] - pub output_file_name: Option, - #[doc = "Possible values for DeploymentProvisioningState."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, - #[doc = "Retry settings for a batch inference operation."] - #[serde(rename = "retrySettings", default, skip_serializing_if = "Option::is_none")] - pub retry_settings: Option, -} -impl BatchDeployment { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties relevant to different deployment types."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchDeploymentConfiguration { - #[doc = "The enumerated property types for batch deployments."] - #[serde(rename = "deploymentConfigurationType")] - pub deployment_configuration_type: BatchDeploymentConfigurationType, -} -impl BatchDeploymentConfiguration { - pub fn new(deployment_configuration_type: BatchDeploymentConfigurationType) -> Self { - Self { - deployment_configuration_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "deploymentConfigurationType")] -pub enum BatchDeploymentConfigurationUnion { - PipelineComponent(BatchPipelineComponentDeploymentConfiguration), -} -#[doc = "The enumerated property types for batch deployments."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BatchDeploymentConfigurationType")] -pub enum BatchDeploymentConfigurationType { - Model, - PipelineComponent, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BatchDeploymentConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BatchDeploymentConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BatchDeploymentConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Model => serializer.serialize_unit_variant("BatchDeploymentConfigurationType", 0u32, "Model"), - Self::PipelineComponent => serializer.serialize_unit_variant("BatchDeploymentConfigurationType", 1u32, "PipelineComponent"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchDeploymentTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Batch inference settings per deployment."] - pub properties: BatchDeployment, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl BatchDeploymentTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: BatchDeployment) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of BatchDeployment entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchDeploymentTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of BatchDeployment objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type BatchDeployment."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for BatchDeploymentTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl BatchDeploymentTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Batch endpoint configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchEndpoint { - #[serde(flatten)] - pub endpoint_properties_base: EndpointPropertiesBase, - #[doc = "Batch endpoint default values"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub defaults: Option, - #[doc = "State of endpoint provisioning."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl BatchEndpoint { - pub fn new(endpoint_properties_base: EndpointPropertiesBase) -> Self { - Self { - endpoint_properties_base, - defaults: None, - provisioning_state: None, - } - } -} -#[doc = "Batch endpoint default values"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchEndpointDefaults { - #[doc = "Name of the deployment that will be default for the endpoint.\r\nThis deployment will end up getting 100% traffic when the endpoint scoring URL is invoked."] - #[serde(rename = "deploymentName", default, skip_serializing_if = "Option::is_none")] - pub deployment_name: Option, -} -impl BatchEndpointDefaults { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchEndpointTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Batch endpoint configuration."] - pub properties: BatchEndpoint, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl BatchEndpointTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: BatchEndpoint) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of BatchEndpoint entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchEndpointTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of BatchEndpoint objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type BatchEndpoint."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for BatchEndpointTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl BatchEndpointTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Log verbosity for batch inferencing.\r\nIncreasing verbosity order for logging is : Warning, Info and Debug.\r\nThe default value is Info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BatchLoggingLevel")] -pub enum BatchLoggingLevel { - Info, - Warning, - Debug, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BatchLoggingLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BatchLoggingLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BatchLoggingLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Info => serializer.serialize_unit_variant("BatchLoggingLevel", 0u32, "Info"), - Self::Warning => serializer.serialize_unit_variant("BatchLoggingLevel", 1u32, "Warning"), - Self::Debug => serializer.serialize_unit_variant("BatchLoggingLevel", 2u32, "Debug"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine how batch inferencing will handle output"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BatchOutputAction")] -pub enum BatchOutputAction { - SummaryOnly, - AppendRow, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BatchOutputAction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BatchOutputAction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BatchOutputAction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SummaryOnly => serializer.serialize_unit_variant("BatchOutputAction", 0u32, "SummaryOnly"), - Self::AppendRow => serializer.serialize_unit_variant("BatchOutputAction", 1u32, "AppendRow"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Properties for a Batch Pipeline Component Deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BatchPipelineComponentDeploymentConfiguration { - #[serde(flatten)] - pub batch_deployment_configuration: BatchDeploymentConfiguration, - #[doc = "Reference to an asset via its ARM resource ID."] - #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] - pub component_id: Option, - #[doc = "The description which will be applied to the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Run-time settings for the pipeline job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option, - #[doc = "The tags which will be applied to the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl BatchPipelineComponentDeploymentConfiguration { - pub fn new(batch_deployment_configuration: BatchDeploymentConfiguration) -> Self { - Self { - batch_deployment_configuration, - component_id: None, - description: None, - settings: None, - tags: None, - } - } -} -#[doc = "Retry settings for a batch inference operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BatchRetrySettings { - #[doc = "Maximum retry count for a mini-batch"] - #[serde(rename = "maxRetries", default, skip_serializing_if = "Option::is_none")] - pub max_retries: Option, - #[doc = "Invocation timeout for a mini-batch, in ISO 8601 format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl BatchRetrySettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines a Sampling Algorithm that generates values based on previous values"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BayesianSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, -} -impl BayesianSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { sampling_algorithm } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BindOptions { - #[doc = "Type of Bind Option"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub propagation: Option, - #[doc = "Indicate whether to create host path."] - #[serde(rename = "createHostPath", default, skip_serializing_if = "Option::is_none")] - pub create_host_path: Option, - #[doc = "Mention the selinux options."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selinux: Option, -} -impl BindOptions { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BlobReferenceForConsumptionDto { - #[doc = "Blob URI path for client to upload data.\r\nExample: https://blob.windows.core.net/Container/Path"] - #[serde(rename = "blobUri", default, skip_serializing_if = "Option::is_none")] - pub blob_uri: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credential: Option, - #[doc = "Arm ID of the storage account to use"] - #[serde(rename = "storageAccountArmId", default, skip_serializing_if = "Option::is_none")] - pub storage_account_arm_id: Option, -} -impl BlobReferenceForConsumptionDto { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum for all classification models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "BlockedTransformers")] -pub enum BlockedTransformers { - TextTargetEncoder, - OneHotEncoder, - CatTargetEncoder, - TfIdf, - WoETargetEncoder, - LabelEncoder, - WordEmbedding, - NaiveBayes, - CountVectorizer, - HashOneHotEncoder, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for BlockedTransformers { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for BlockedTransformers { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for BlockedTransformers { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::TextTargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 0u32, "TextTargetEncoder"), - Self::OneHotEncoder => serializer.serialize_unit_variant("BlockedTransformers", 1u32, "OneHotEncoder"), - Self::CatTargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 2u32, "CatTargetEncoder"), - Self::TfIdf => serializer.serialize_unit_variant("BlockedTransformers", 3u32, "TfIdf"), - Self::WoETargetEncoder => serializer.serialize_unit_variant("BlockedTransformers", 4u32, "WoETargetEncoder"), - Self::LabelEncoder => serializer.serialize_unit_variant("BlockedTransformers", 5u32, "LabelEncoder"), - Self::WordEmbedding => serializer.serialize_unit_variant("BlockedTransformers", 6u32, "WordEmbedding"), - Self::NaiveBayes => serializer.serialize_unit_variant("BlockedTransformers", 7u32, "NaiveBayes"), - Self::CountVectorizer => serializer.serialize_unit_variant("BlockedTransformers", 8u32, "CountVectorizer"), - Self::HashOneHotEncoder => serializer.serialize_unit_variant("BlockedTransformers", 9u32, "HashOneHotEncoder"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Configuration settings for Docker build context"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BuildContext { - #[doc = "[Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs.\r\n"] - #[serde(rename = "contextUri")] - pub context_uri: String, - #[doc = "Path to the Dockerfile in the build context.\r\n"] - #[serde(rename = "dockerfilePath", default, skip_serializing_if = "Option::is_none")] - pub dockerfile_path: Option, -} -impl BuildContext { - pub fn new(context_uri: String) -> Self { - Self { - context_uri, - dockerfile_path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CategoricalDataDriftMetric")] -pub enum CategoricalDataDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - PearsonsChiSquaredTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CategoricalDataDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CategoricalDataDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CategoricalDataDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => serializer.serialize_unit_variant("CategoricalDataDriftMetric", 0u32, "JensenShannonDistance"), - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("CategoricalDataDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::PearsonsChiSquaredTest => serializer.serialize_unit_variant("CategoricalDataDriftMetric", 2u32, "PearsonsChiSquaredTest"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CategoricalDataDriftMetricThreshold { - #[serde(flatten)] - pub data_drift_metric_threshold_base: DataDriftMetricThresholdBase, - pub metric: CategoricalDataDriftMetric, -} -impl CategoricalDataDriftMetricThreshold { - pub fn new(data_drift_metric_threshold_base: DataDriftMetricThresholdBase, metric: CategoricalDataDriftMetric) -> Self { - Self { - data_drift_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CategoricalDataQualityMetric")] -pub enum CategoricalDataQualityMetric { - NullValueRate, - DataTypeErrorRate, - OutOfBoundsRate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CategoricalDataQualityMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CategoricalDataQualityMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CategoricalDataQualityMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NullValueRate => serializer.serialize_unit_variant("CategoricalDataQualityMetric", 0u32, "NullValueRate"), - Self::DataTypeErrorRate => serializer.serialize_unit_variant("CategoricalDataQualityMetric", 1u32, "DataTypeErrorRate"), - Self::OutOfBoundsRate => serializer.serialize_unit_variant("CategoricalDataQualityMetric", 2u32, "OutOfBoundsRate"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CategoricalDataQualityMetricThreshold { - #[serde(flatten)] - pub data_quality_metric_threshold_base: DataQualityMetricThresholdBase, - pub metric: CategoricalDataQualityMetric, -} -impl CategoricalDataQualityMetricThreshold { - pub fn new(data_quality_metric_threshold_base: DataQualityMetricThresholdBase, metric: CategoricalDataQualityMetric) -> Self { - Self { - data_quality_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CategoricalPredictionDriftMetric")] -pub enum CategoricalPredictionDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - PearsonsChiSquaredTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CategoricalPredictionDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CategoricalPredictionDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CategoricalPredictionDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => { - serializer.serialize_unit_variant("CategoricalPredictionDriftMetric", 0u32, "JensenShannonDistance") - } - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("CategoricalPredictionDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::PearsonsChiSquaredTest => { - serializer.serialize_unit_variant("CategoricalPredictionDriftMetric", 2u32, "PearsonsChiSquaredTest") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CategoricalPredictionDriftMetricThreshold { - #[serde(flatten)] - pub prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, - pub metric: CategoricalPredictionDriftMetric, -} -impl CategoricalPredictionDriftMetricThreshold { - pub fn new( - prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, - metric: CategoricalPredictionDriftMetric, - ) -> Self { - Self { - prediction_drift_metric_threshold_base, - metric, - } - } -} -#[doc = "Certificate datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Authority URL used for authentication."] - #[serde(rename = "authorityUrl", default, skip_serializing_if = "Option::is_none")] - pub authority_url: Option, - #[doc = "[Required] Service principal client ID."] - #[serde(rename = "clientId")] - pub client_id: String, - #[doc = "Resource the service principal has access to."] - #[serde(rename = "resourceUrl", default, skip_serializing_if = "Option::is_none")] - pub resource_url: Option, - #[doc = "Datastore certificate secrets."] - pub secrets: CertificateDatastoreSecrets, - #[doc = "[Required] ID of the tenant to which the service principal belongs."] - #[serde(rename = "tenantId")] - pub tenant_id: String, - #[doc = "[Required] Thumbprint of the certificate used for authentication."] - pub thumbprint: String, -} -impl CertificateDatastoreCredentials { - pub fn new( - datastore_credentials: DatastoreCredentials, - client_id: String, - secrets: CertificateDatastoreSecrets, - tenant_id: String, - thumbprint: String, - ) -> Self { - Self { - datastore_credentials, - authority_url: None, - client_id, - resource_url: None, - secrets, - tenant_id, - thumbprint, - } - } -} -#[doc = "Datastore certificate secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Service principal certificate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub certificate: Option, -} -impl CertificateDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - certificate: None, - } - } -} -#[doc = "Classification task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Classification { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Positive label for binary metrics calculation."] - #[serde(rename = "positiveLabel", default, skip_serializing_if = "Option::is_none")] - pub positive_label: Option, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Classification Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Classification { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - positive_label: None, - primary_metric: None, - training_settings: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationModelPerformanceMetric")] -pub enum ClassificationModelPerformanceMetric { - Accuracy, - Precision, - Recall, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationModelPerformanceMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationModelPerformanceMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationModelPerformanceMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Accuracy => serializer.serialize_unit_variant("ClassificationModelPerformanceMetric", 0u32, "Accuracy"), - Self::Precision => serializer.serialize_unit_variant("ClassificationModelPerformanceMetric", 1u32, "Precision"), - Self::Recall => serializer.serialize_unit_variant("ClassificationModelPerformanceMetric", 2u32, "Recall"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ClassificationModelPerformanceMetricThreshold { - #[serde(flatten)] - pub model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - pub metric: ClassificationModelPerformanceMetric, -} -impl ClassificationModelPerformanceMetricThreshold { - pub fn new( - model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - metric: ClassificationModelPerformanceMetric, - ) -> Self { - Self { - model_performance_metric_threshold_base, - metric, - } - } -} -#[doc = "Enum for all classification models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationModels")] -pub enum ClassificationModels { - LogisticRegression, - #[serde(rename = "SGD")] - Sgd, - MultinomialNaiveBayes, - BernoulliNaiveBayes, - #[serde(rename = "SVM")] - Svm, - #[serde(rename = "LinearSVM")] - LinearSvm, - #[serde(rename = "KNN")] - Knn, - DecisionTree, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - GradientBoosting, - #[serde(rename = "XGBoostClassifier")] - XgBoostClassifier, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationModels { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationModels { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationModels { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::LogisticRegression => serializer.serialize_unit_variant("ClassificationModels", 0u32, "LogisticRegression"), - Self::Sgd => serializer.serialize_unit_variant("ClassificationModels", 1u32, "SGD"), - Self::MultinomialNaiveBayes => serializer.serialize_unit_variant("ClassificationModels", 2u32, "MultinomialNaiveBayes"), - Self::BernoulliNaiveBayes => serializer.serialize_unit_variant("ClassificationModels", 3u32, "BernoulliNaiveBayes"), - Self::Svm => serializer.serialize_unit_variant("ClassificationModels", 4u32, "SVM"), - Self::LinearSvm => serializer.serialize_unit_variant("ClassificationModels", 5u32, "LinearSVM"), - Self::Knn => serializer.serialize_unit_variant("ClassificationModels", 6u32, "KNN"), - Self::DecisionTree => serializer.serialize_unit_variant("ClassificationModels", 7u32, "DecisionTree"), - Self::RandomForest => serializer.serialize_unit_variant("ClassificationModels", 8u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("ClassificationModels", 9u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("ClassificationModels", 10u32, "LightGBM"), - Self::GradientBoosting => serializer.serialize_unit_variant("ClassificationModels", 11u32, "GradientBoosting"), - Self::XgBoostClassifier => serializer.serialize_unit_variant("ClassificationModels", 12u32, "XGBoostClassifier"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for classification multilabel tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationMultilabelPrimaryMetrics")] -pub enum ClassificationMultilabelPrimaryMetrics { - #[serde(rename = "AUCWeighted")] - AucWeighted, - Accuracy, - NormMacroRecall, - AveragePrecisionScoreWeighted, - PrecisionScoreWeighted, - #[serde(rename = "IOU")] - Iou, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationMultilabelPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationMultilabelPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationMultilabelPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AucWeighted => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 0u32, "AUCWeighted"), - Self::Accuracy => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 1u32, "Accuracy"), - Self::NormMacroRecall => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 2u32, "NormMacroRecall"), - Self::AveragePrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 3u32, "AveragePrecisionScoreWeighted") - } - Self::PrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 4u32, "PrecisionScoreWeighted") - } - Self::Iou => serializer.serialize_unit_variant("ClassificationMultilabelPrimaryMetrics", 5u32, "IOU"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for classification tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ClassificationPrimaryMetrics")] -pub enum ClassificationPrimaryMetrics { - #[serde(rename = "AUCWeighted")] - AucWeighted, - Accuracy, - NormMacroRecall, - AveragePrecisionScoreWeighted, - PrecisionScoreWeighted, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ClassificationPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ClassificationPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ClassificationPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AucWeighted => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 0u32, "AUCWeighted"), - Self::Accuracy => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 1u32, "Accuracy"), - Self::NormMacroRecall => serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 2u32, "NormMacroRecall"), - Self::AveragePrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 3u32, "AveragePrecisionScoreWeighted") - } - Self::PrecisionScoreWeighted => { - serializer.serialize_unit_variant("ClassificationPrimaryMetrics", 4u32, "PrecisionScoreWeighted") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Classification Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClassificationTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for classification task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for classification task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl ClassificationTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "AmlCompute update parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClusterUpdateParameters { - #[doc = "The properties of a amlCompute that need to be updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ClusterUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a amlCompute that need to be updated."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClusterUpdateProperties { - #[doc = "Desired scale settings for the amlCompute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ClusterUpdateProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CocoExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CocoExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} -#[doc = "Configuration for a scoring code asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CodeConfiguration { - #[doc = "ARM resource ID of the code asset."] - #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] - pub code_id: Option, - #[doc = "[Required] The script to execute on startup. eg. \"score.py\""] - #[serde(rename = "scoringScript")] - pub scoring_script: String, -} -impl CodeConfiguration { - pub fn new(scoring_script: String) -> Self { - Self { - code_id: None, - scoring_script, - } - } -} -#[doc = "Container for code asset versions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl CodeContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CodeContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Container for code asset versions."] - pub properties: CodeContainer, -} -impl CodeContainerResource { - pub fn new(properties: CodeContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of CodeContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of CodeContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type CodeContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for CodeContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl CodeContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Code asset version details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Uri where code is located"] - #[serde(rename = "codeUri", default, skip_serializing_if = "Option::is_none")] - pub code_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl CodeVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CodeVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Code asset version details."] - pub properties: CodeVersion, -} -impl CodeVersionResource { - pub fn new(properties: CodeVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of CodeVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CodeVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of CodeVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type CodeVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for CodeVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl CodeVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Collection { - #[doc = "The msi client id used to collect logging to blob storage. If it's null,backend will pick a registered endpoint identity to auth."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "dataCollectionMode", default, skip_serializing_if = "Option::is_none")] - pub data_collection_mode: Option, - #[doc = "The data asset arm resource id. Client side will ensure data asset is pointing to the blob storage, and backend will collect data to the blob storage."] - #[serde(rename = "dataId", default, skip_serializing_if = "Option::is_none")] - pub data_id: Option, - #[doc = "The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data by default."] - #[serde(rename = "samplingRate", default, skip_serializing_if = "Option::is_none")] - pub sampling_rate: Option, -} -impl Collection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Column transformer parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ColumnTransformer { - #[doc = "Fields to apply transformer logic on."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub fields: Vec, - #[doc = "Different properties to be passed to transformer.\r\nInput expected is dictionary of key,value pairs in JSON format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, -} -impl ColumnTransformer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Command job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Settings for Autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, - #[doc = "ARM resource ID of the code asset."] - #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] - pub code_id: Option, - #[doc = "[Required] The command to execute on startup of the job. eg. \"python train.py\""] - pub command: String, - #[doc = "Base definition for job distribution configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, - #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId")] - pub environment_id: String, - #[doc = "Environment variables included in the job."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Command Job limit class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Input parameters."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl CommandJob { - pub fn new(job_base: JobBase, command: String, environment_id: String) -> Self { - Self { - job_base, - autologger_settings: None, - code_id: None, - command, - distribution: None, - environment_id, - environment_variables: None, - inputs: None, - limits: None, - outputs: None, - parameters: None, - queue_settings: None, - resources: None, - } - } -} -#[doc = "Command Job limit class."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommandJobLimits { - #[serde(flatten)] - pub job_limits: JobLimits, -} -impl CommandJobLimits { - pub fn new(job_limits: JobLimits) -> Self { - Self { job_limits } - } -} -#[doc = "Component container definition.\r\n"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl ComponentContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComponentContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Component container definition.\r\n"] - pub properties: ComponentContainer, -} -impl ComponentContainerResource { - pub fn new(properties: ComponentContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ComponentContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of ComponentContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ComponentContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ComponentContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ComponentContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Definition of a component version: defines resources that span component types."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Defines Component definition details.\r\n"] - #[serde(rename = "componentSpec", default, skip_serializing_if = "Option::is_none")] - pub component_spec: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Stage in the component lifecycle"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl ComponentVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComponentVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Definition of a component version: defines resources that span component types."] - pub properties: ComponentVersion, -} -impl ComponentVersionResource { - pub fn new(properties: ComponentVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ComponentVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComponentVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of ComponentVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ComponentVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ComponentVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ComponentVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Machine Learning compute object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Compute { - #[doc = "The type of compute"] - #[serde(rename = "computeType")] - pub compute_type: ComputeType, - #[doc = "Location for the underlying compute"] - #[serde(rename = "computeLocation", default, skip_serializing_if = "Option::is_none")] - pub compute_location: Option, - #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "The description of the Machine Learning compute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The time at which the compute was created."] - #[serde(rename = "createdOn", default, with = "azure_core::date::rfc3339::option")] - pub created_on: Option, - #[doc = "The time at which the compute was last modified."] - #[serde(rename = "modifiedOn", default, with = "azure_core::date::rfc3339::option")] - pub modified_on: Option, - #[doc = "ARM resource id of the underlying compute"] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, - #[doc = "Errors during provisioning"] - #[serde( - rename = "provisioningErrors", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub provisioning_errors: Vec, - #[doc = "Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false."] - #[serde(rename = "isAttachedCompute", default, skip_serializing_if = "Option::is_none")] - pub is_attached_compute: Option, - #[doc = "Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication."] - #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] - pub disable_local_auth: Option, -} -impl Compute { - pub fn new(compute_type: ComputeType) -> Self { - Self { - compute_type, - compute_location: None, - provisioning_state: None, - description: None, - created_on: None, - modified_on: None, - resource_id: None, - provisioning_errors: Vec::new(), - is_attached_compute: None, - disable_local_auth: None, - } - } -} -pub mod compute { - use super::*; - #[doc = "The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ProvisioningState")] - pub enum ProvisioningState { - Unknown, - Updating, - Creating, - Deleting, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), - Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), - Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "computeType")] -pub enum ComputeUnion { - #[serde(rename = "AKS")] - Aks(Aks), - AmlCompute(AmlCompute), - ComputeInstance(ComputeInstance), - DataFactory(DataFactory), - DataLakeAnalytics(DataLakeAnalytics), - Databricks(Databricks), - #[serde(rename = "HDInsight")] - HdInsight(HdInsight), - Kubernetes(Kubernetes), - SynapseSpark(SynapseSpark), - VirtualMachine(VirtualMachine), -} -#[doc = "An Azure Machine Learning compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComputeInstance { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub compute_instance_schema: ComputeInstanceSchema, -} -impl ComputeInstance { - pub fn new(compute: Compute) -> Self { - Self { - compute, - compute_instance_schema: ComputeInstanceSchema::default(), - } - } -} -#[doc = "Defines an Aml Instance application and its connectivity endpoint URI."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceApplication { - #[doc = "Name of the ComputeInstance application."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Application' endpoint URI."] - #[serde(rename = "endpointUri", default, skip_serializing_if = "Option::is_none")] - pub endpoint_uri: Option, -} -impl ComputeInstanceApplication { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Specifies settings for autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceAutologgerSettings { - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[serde(rename = "mlflowAutologger", default, skip_serializing_if = "Option::is_none")] - pub mlflow_autologger: Option, -} -impl ComputeInstanceAutologgerSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_autologger_settings { - use super::*; - #[doc = "Indicates whether mlflow autologger is enabled for notebooks."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MlflowAutologger")] - pub enum MlflowAutologger { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MlflowAutologger { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MlflowAutologger { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MlflowAutologger { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlflowAutologger", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlflowAutologger", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceConnectivityEndpoints { - #[doc = "Public IP Address of this ComputeInstance."] - #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] - pub public_ip_address: Option, - #[doc = "Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed)."] - #[serde(rename = "privateIpAddress", default, skip_serializing_if = "Option::is_none")] - pub private_ip_address: Option, -} -impl ComputeInstanceConnectivityEndpoints { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines an Aml Instance container."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceContainer { - #[doc = "Name of the ComputeInstance container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Auto save settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub autosave: Option, - #[doc = "Information of GPU."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gpu: Option, - #[doc = "network of this container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub network: Option, - #[doc = "Environment information"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option, - #[doc = "services of this containers."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub services: Vec, -} -impl ComputeInstanceContainer { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_container { - use super::*; - #[doc = "Auto save settings."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Autosave")] - pub enum Autosave { - None, - Local, - Remote, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Autosave { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Autosave { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Autosave { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("Autosave", 0u32, "None"), - Self::Local => serializer.serialize_unit_variant("Autosave", 1u32, "Local"), - Self::Remote => serializer.serialize_unit_variant("Autosave", 2u32, "Remote"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "network of this container."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Network")] - pub enum Network { - Bridge, - Host, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Network { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Network { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Network { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bridge => serializer.serialize_unit_variant("Network", 0u32, "Bridge"), - Self::Host => serializer.serialize_unit_variant("Network", 1u32, "Host"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Describes information on user who created this ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceCreatedBy { - #[doc = "Name of the user."] - #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] - pub user_name: Option, - #[doc = "Uniquely identifies user' Azure Active Directory organization."] - #[serde(rename = "userOrgId", default, skip_serializing_if = "Option::is_none")] - pub user_org_id: Option, - #[doc = "Uniquely identifies the user within his/her organization."] - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, -} -impl ComputeInstanceCreatedBy { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines an Aml Instance DataDisk."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceDataDisk { - #[doc = "Caching type of Data Disk."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub caching: Option, - #[doc = "The initial disk size in gigabytes."] - #[serde(rename = "diskSizeGB", default, skip_serializing_if = "Option::is_none")] - pub disk_size_gb: Option, - #[doc = "The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub lun: Option, - #[doc = "type of this storage account."] - #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] - pub storage_account_type: Option, -} -impl ComputeInstanceDataDisk { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_data_disk { - use super::*; - #[doc = "Caching type of Data Disk."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Caching")] - pub enum Caching { - None, - ReadOnly, - ReadWrite, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Caching { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Caching { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Caching { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("Caching", 0u32, "None"), - Self::ReadOnly => serializer.serialize_unit_variant("Caching", 1u32, "ReadOnly"), - Self::ReadWrite => serializer.serialize_unit_variant("Caching", 2u32, "ReadWrite"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "type of this storage account."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "StorageAccountType")] - pub enum StorageAccountType { - #[serde(rename = "Standard_LRS")] - StandardLrs, - #[serde(rename = "Premium_LRS")] - PremiumLrs, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for StorageAccountType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for StorageAccountType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for StorageAccountType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::StandardLrs => serializer.serialize_unit_variant("StorageAccountType", 0u32, "Standard_LRS"), - Self::PremiumLrs => serializer.serialize_unit_variant("StorageAccountType", 1u32, "Premium_LRS"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for StorageAccountType { - fn default() -> Self { - Self::StandardLrs - } - } -} -#[doc = "Defines an Aml Instance DataMount."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceDataMount { - #[doc = "Source of the ComputeInstance data mount."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Data source type."] - #[serde(rename = "sourceType", default, skip_serializing_if = "Option::is_none")] - pub source_type: Option, - #[doc = "name of the ComputeInstance data mount."] - #[serde(rename = "mountName", default, skip_serializing_if = "Option::is_none")] - pub mount_name: Option, - #[doc = "Mount Action."] - #[serde(rename = "mountAction", default, skip_serializing_if = "Option::is_none")] - pub mount_action: Option, - #[doc = "who this data mount created by."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "Path of this data mount."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, - #[doc = "Mount state."] - #[serde(rename = "mountState", default, skip_serializing_if = "Option::is_none")] - pub mount_state: Option, - #[doc = "The time when the disk mounted."] - #[serde(rename = "mountedOn", default, with = "azure_core::date::rfc3339::option")] - pub mounted_on: Option, - #[doc = "Error of this data mount."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl ComputeInstanceDataMount { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_data_mount { - use super::*; - #[doc = "Data source type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "SourceType")] - pub enum SourceType { - Dataset, - Datastore, - #[serde(rename = "URI")] - Uri, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for SourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for SourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for SourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dataset => serializer.serialize_unit_variant("SourceType", 0u32, "Dataset"), - Self::Datastore => serializer.serialize_unit_variant("SourceType", 1u32, "Datastore"), - Self::Uri => serializer.serialize_unit_variant("SourceType", 2u32, "URI"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Mount Action."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MountAction")] - pub enum MountAction { - Mount, - Unmount, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MountAction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MountAction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MountAction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Mount => serializer.serialize_unit_variant("MountAction", 0u32, "Mount"), - Self::Unmount => serializer.serialize_unit_variant("MountAction", 1u32, "Unmount"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Mount state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MountState")] - pub enum MountState { - MountRequested, - Mounted, - MountFailed, - UnmountRequested, - UnmountFailed, - Unmounted, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MountState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MountState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MountState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MountRequested => serializer.serialize_unit_variant("MountState", 0u32, "MountRequested"), - Self::Mounted => serializer.serialize_unit_variant("MountState", 1u32, "Mounted"), - Self::MountFailed => serializer.serialize_unit_variant("MountState", 2u32, "MountFailed"), - Self::UnmountRequested => serializer.serialize_unit_variant("MountState", 3u32, "UnmountRequested"), - Self::UnmountFailed => serializer.serialize_unit_variant("MountState", 4u32, "UnmountFailed"), - Self::Unmounted => serializer.serialize_unit_variant("MountState", 5u32, "Unmounted"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Environment information"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceEnvironmentInfo { - #[doc = "name of environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "version of environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, -} -impl ComputeInstanceEnvironmentInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The last operation on ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceLastOperation { - #[doc = "Name of the last operation."] - #[serde(rename = "operationName", default, skip_serializing_if = "Option::is_none")] - pub operation_name: Option, - #[doc = "Time of the last operation."] - #[serde(rename = "operationTime", default, with = "azure_core::date::rfc3339::option")] - pub operation_time: Option, - #[doc = "Operation status."] - #[serde(rename = "operationStatus", default, skip_serializing_if = "Option::is_none")] - pub operation_status: Option, - #[doc = "Trigger of operation."] - #[serde(rename = "operationTrigger", default, skip_serializing_if = "Option::is_none")] - pub operation_trigger: Option, -} -impl ComputeInstanceLastOperation { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_last_operation { - use super::*; - #[doc = "Name of the last operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OperationName")] - pub enum OperationName { - Create, - Start, - Stop, - Restart, - Reimage, - Delete, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OperationName { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OperationName { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OperationName { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Create => serializer.serialize_unit_variant("OperationName", 0u32, "Create"), - Self::Start => serializer.serialize_unit_variant("OperationName", 1u32, "Start"), - Self::Stop => serializer.serialize_unit_variant("OperationName", 2u32, "Stop"), - Self::Restart => serializer.serialize_unit_variant("OperationName", 3u32, "Restart"), - Self::Reimage => serializer.serialize_unit_variant("OperationName", 4u32, "Reimage"), - Self::Delete => serializer.serialize_unit_variant("OperationName", 5u32, "Delete"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Operation status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OperationStatus")] - pub enum OperationStatus { - InProgress, - Succeeded, - CreateFailed, - StartFailed, - StopFailed, - RestartFailed, - ReimageFailed, - DeleteFailed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OperationStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OperationStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OperationStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::InProgress => serializer.serialize_unit_variant("OperationStatus", 0u32, "InProgress"), - Self::Succeeded => serializer.serialize_unit_variant("OperationStatus", 1u32, "Succeeded"), - Self::CreateFailed => serializer.serialize_unit_variant("OperationStatus", 2u32, "CreateFailed"), - Self::StartFailed => serializer.serialize_unit_variant("OperationStatus", 3u32, "StartFailed"), - Self::StopFailed => serializer.serialize_unit_variant("OperationStatus", 4u32, "StopFailed"), - Self::RestartFailed => serializer.serialize_unit_variant("OperationStatus", 5u32, "RestartFailed"), - Self::ReimageFailed => serializer.serialize_unit_variant("OperationStatus", 6u32, "ReimageFailed"), - Self::DeleteFailed => serializer.serialize_unit_variant("OperationStatus", 7u32, "DeleteFailed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Trigger of operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OperationTrigger")] - pub enum OperationTrigger { - User, - Schedule, - IdleShutdown, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OperationTrigger { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OperationTrigger { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OperationTrigger { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("OperationTrigger", 0u32, "User"), - Self::Schedule => serializer.serialize_unit_variant("OperationTrigger", 1u32, "Schedule"), - Self::IdleShutdown => serializer.serialize_unit_variant("OperationTrigger", 2u32, "IdleShutdown"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Compute Instance properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceProperties { - #[doc = "Virtual Machine Size"] - #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] - pub vm_size: Option, - #[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subnet: Option, - #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] - #[serde(rename = "applicationSharingPolicy", default, skip_serializing_if = "Option::is_none")] - pub application_sharing_policy: Option, - #[doc = "Specifies settings for autologger."] - #[serde(rename = "autologgerSettings", default, skip_serializing_if = "Option::is_none")] - pub autologger_settings: Option, - #[doc = "Specifies policy and settings for SSH access."] - #[serde(rename = "sshSettings", default, skip_serializing_if = "Option::is_none")] - pub ssh_settings: Option, - #[doc = "List of Custom Services added to the compute."] - #[serde( - rename = "customServices", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub custom_services: Vec, - #[doc = "Returns metadata about the operating system image for this compute instance."] - #[serde(rename = "osImageMetadata", default, skip_serializing_if = "Option::is_none")] - pub os_image_metadata: Option, - #[doc = "Defines all connectivity endpoints and properties for an ComputeInstance."] - #[serde(rename = "connectivityEndpoints", default, skip_serializing_if = "Option::is_none")] - pub connectivity_endpoints: Option, - #[doc = "Describes available applications and their endpoints on this ComputeInstance."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub applications: Vec, - #[doc = "Describes information on user who created this ComputeInstance."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "Collection of errors encountered on this ComputeInstance."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub errors: Vec, - #[doc = "Current state of an ComputeInstance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] - #[serde(rename = "computeInstanceAuthorizationType", default, skip_serializing_if = "Option::is_none")] - pub compute_instance_authorization_type: Option, - #[doc = "Settings for a personal compute instance."] - #[serde(rename = "personalComputeInstanceSettings", default, skip_serializing_if = "Option::is_none")] - pub personal_compute_instance_settings: Option, - #[doc = "Details of customized scripts to execute for setting up the cluster."] - #[serde(rename = "setupScripts", default, skip_serializing_if = "Option::is_none")] - pub setup_scripts: Option, - #[doc = "The last operation on ComputeInstance."] - #[serde(rename = "lastOperation", default, skip_serializing_if = "Option::is_none")] - pub last_operation: Option, - #[doc = "The list of schedules to be applied on the computes"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedules: Option, - #[doc = "Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, - #[doc = "Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs."] - #[serde(rename = "enableNodePublicIp", default, skip_serializing_if = "Option::is_none")] - pub enable_node_public_ip: Option, - #[doc = "Describes informations of containers on this ComputeInstance."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub containers: Vec, - #[doc = "Describes informations of dataDisks on this ComputeInstance."] - #[serde( - rename = "dataDisks", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub data_disks: Vec, - #[doc = "Describes informations of dataMounts on this ComputeInstance."] - #[serde( - rename = "dataMounts", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub data_mounts: Vec, - #[doc = "Version of computeInstance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub versions: Option, -} -impl ComputeInstanceProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_properties { - use super::*; - #[doc = "Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ApplicationSharingPolicy")] - pub enum ApplicationSharingPolicy { - Personal, - Shared, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ApplicationSharingPolicy { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ApplicationSharingPolicy { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ApplicationSharingPolicy { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Personal => serializer.serialize_unit_variant("ApplicationSharingPolicy", 0u32, "Personal"), - Self::Shared => serializer.serialize_unit_variant("ApplicationSharingPolicy", 1u32, "Shared"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for ApplicationSharingPolicy { - fn default() -> Self { - Self::Shared - } - } - #[doc = "The Compute Instance Authorization type. Available values are personal (default)."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ComputeInstanceAuthorizationType")] - pub enum ComputeInstanceAuthorizationType { - #[serde(rename = "personal")] - Personal, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ComputeInstanceAuthorizationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ComputeInstanceAuthorizationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ComputeInstanceAuthorizationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Personal => serializer.serialize_unit_variant("ComputeInstanceAuthorizationType", 0u32, "personal"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for ComputeInstanceAuthorizationType { - fn default() -> Self { - Self::Personal - } - } -} -#[doc = "Properties(top level) of ComputeInstance"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceSchema { - #[doc = "Compute Instance properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ComputeInstanceSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Specifies policy and settings for SSH access."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceSshSettings { - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] - #[serde(rename = "sshPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub ssh_public_access: Option, - #[doc = "Describes the admin user name."] - #[serde(rename = "adminUserName", default, skip_serializing_if = "Option::is_none")] - pub admin_user_name: Option, - #[doc = "Describes the port for connecting through SSH."] - #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] - pub ssh_port: Option, - #[doc = "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs."] - #[serde(rename = "adminPublicKey", default, skip_serializing_if = "Option::is_none")] - pub admin_public_key: Option, -} -impl ComputeInstanceSshSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_instance_ssh_settings { - use super::*; - #[doc = "State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "SshPublicAccess")] - pub enum SshPublicAccess { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for SshPublicAccess { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for SshPublicAccess { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for SshPublicAccess { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("SshPublicAccess", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("SshPublicAccess", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for SshPublicAccess { - fn default() -> Self { - Self::Disabled - } - } -} -#[doc = "Current state of an ComputeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ComputeInstanceState")] -pub enum ComputeInstanceState { - Creating, - CreateFailed, - Deleting, - Running, - Restarting, - JobRunning, - SettingUp, - SetupFailed, - Starting, - Stopped, - Stopping, - UserSettingUp, - UserSetupFailed, - Unknown, - Unusable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ComputeInstanceState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ComputeInstanceState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ComputeInstanceState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("ComputeInstanceState", 0u32, "Creating"), - Self::CreateFailed => serializer.serialize_unit_variant("ComputeInstanceState", 1u32, "CreateFailed"), - Self::Deleting => serializer.serialize_unit_variant("ComputeInstanceState", 2u32, "Deleting"), - Self::Running => serializer.serialize_unit_variant("ComputeInstanceState", 3u32, "Running"), - Self::Restarting => serializer.serialize_unit_variant("ComputeInstanceState", 4u32, "Restarting"), - Self::JobRunning => serializer.serialize_unit_variant("ComputeInstanceState", 5u32, "JobRunning"), - Self::SettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 6u32, "SettingUp"), - Self::SetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 7u32, "SetupFailed"), - Self::Starting => serializer.serialize_unit_variant("ComputeInstanceState", 8u32, "Starting"), - Self::Stopped => serializer.serialize_unit_variant("ComputeInstanceState", 9u32, "Stopped"), - Self::Stopping => serializer.serialize_unit_variant("ComputeInstanceState", 10u32, "Stopping"), - Self::UserSettingUp => serializer.serialize_unit_variant("ComputeInstanceState", 11u32, "UserSettingUp"), - Self::UserSetupFailed => serializer.serialize_unit_variant("ComputeInstanceState", 12u32, "UserSetupFailed"), - Self::Unknown => serializer.serialize_unit_variant("ComputeInstanceState", 13u32, "Unknown"), - Self::Unusable => serializer.serialize_unit_variant("ComputeInstanceState", 14u32, "Unusable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Version of computeInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeInstanceVersion { - #[doc = "Runtime of compute instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub runtime: Option, -} -impl ComputeInstanceVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "[Required] The compute power action."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ComputePowerAction")] -pub enum ComputePowerAction { - Start, - Stop, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ComputePowerAction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ComputePowerAction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ComputePowerAction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Start => serializer.serialize_unit_variant("ComputePowerAction", 0u32, "Start"), - Self::Stop => serializer.serialize_unit_variant("ComputePowerAction", 1u32, "Stop"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Machine Learning compute object wrapped into ARM resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeResource { - #[serde(flatten)] - pub resource: Resource, - #[serde(flatten)] - pub compute_resource_schema: ComputeResourceSchema, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Specifies the location of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Contains resource tags defined as key/value pairs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl ComputeResource { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeResourceSchema { - #[doc = "Machine Learning compute object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ComputeResourceSchema { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeRuntimeDto { - #[serde(rename = "sparkRuntimeVersion", default, skip_serializing_if = "Option::is_none")] - pub spark_runtime_version: Option, -} -impl ComputeRuntimeDto { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The list of schedules to be applied on the computes"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeSchedules { - #[doc = "The list of compute start stop schedules to be applied."] - #[serde( - rename = "computeStartStop", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub compute_start_stop: Vec, -} -impl ComputeSchedules { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Secrets related to a Machine Learning compute. Might differ for every type of compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ComputeSecrets { - #[doc = "The type of compute"] - #[serde(rename = "computeType")] - pub compute_type: ComputeType, -} -impl ComputeSecrets { - pub fn new(compute_type: ComputeType) -> Self { - Self { compute_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "computeType")] -pub enum ComputeSecretsUnion { - #[serde(rename = "AKS")] - Aks(AksComputeSecrets), - Databricks(DatabricksComputeSecrets), - VirtualMachine(VirtualMachineSecrets), -} -#[doc = "Compute start stop schedule properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComputeStartStopSchedule { - #[doc = "A system assigned id for the schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The current deployment state of schedule."] - #[serde(rename = "provisioningStatus", default, skip_serializing_if = "Option::is_none")] - pub provisioning_status: Option, - #[doc = "Is the schedule enabled or disabled?"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "[Required] The compute power action."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option, - #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] - pub trigger_type: Option, - #[doc = "The workflow trigger recurrence for ComputeStartStop schedule type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub recurrence: Option, - #[doc = "The workflow trigger cron for ComputeStartStop schedule type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cron: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl ComputeStartStopSchedule { - pub fn new() -> Self { - Self::default() - } -} -pub mod compute_start_stop_schedule { - use super::*; - #[doc = "The current deployment state of schedule."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ProvisioningStatus")] - pub enum ProvisioningStatus { - Completed, - Provisioning, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ProvisioningStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ProvisioningStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ProvisioningStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Completed => serializer.serialize_unit_variant("ProvisioningStatus", 0u32, "Completed"), - Self::Provisioning => serializer.serialize_unit_variant("ProvisioningStatus", 1u32, "Provisioning"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningStatus", 2u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The type of compute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ComputeType")] -pub enum ComputeType { - #[serde(rename = "AKS")] - Aks, - Kubernetes, - AmlCompute, - ComputeInstance, - DataFactory, - VirtualMachine, - #[serde(rename = "HDInsight")] - HdInsight, - Databricks, - DataLakeAnalytics, - SynapseSpark, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ComputeType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ComputeType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ComputeType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Aks => serializer.serialize_unit_variant("ComputeType", 0u32, "AKS"), - Self::Kubernetes => serializer.serialize_unit_variant("ComputeType", 1u32, "Kubernetes"), - Self::AmlCompute => serializer.serialize_unit_variant("ComputeType", 2u32, "AmlCompute"), - Self::ComputeInstance => serializer.serialize_unit_variant("ComputeType", 3u32, "ComputeInstance"), - Self::DataFactory => serializer.serialize_unit_variant("ComputeType", 4u32, "DataFactory"), - Self::VirtualMachine => serializer.serialize_unit_variant("ComputeType", 5u32, "VirtualMachine"), - Self::HdInsight => serializer.serialize_unit_variant("ComputeType", 6u32, "HDInsight"), - Self::Databricks => serializer.serialize_unit_variant("ComputeType", 7u32, "Databricks"), - Self::DataLakeAnalytics => serializer.serialize_unit_variant("ComputeType", 8u32, "DataLakeAnalytics"), - Self::SynapseSpark => serializer.serialize_unit_variant("ComputeType", 9u32, "SynapseSpark"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Authentication type of the connection target"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ConnectionAuthType")] -pub enum ConnectionAuthType { - #[serde(rename = "PAT")] - Pat, - ManagedIdentity, - UsernamePassword, - None, - #[serde(rename = "SAS")] - Sas, - ServicePrincipal, - AccessKey, - ApiKey, - CustomKeys, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ConnectionAuthType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ConnectionAuthType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ConnectionAuthType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Pat => serializer.serialize_unit_variant("ConnectionAuthType", 0u32, "PAT"), - Self::ManagedIdentity => serializer.serialize_unit_variant("ConnectionAuthType", 1u32, "ManagedIdentity"), - Self::UsernamePassword => serializer.serialize_unit_variant("ConnectionAuthType", 2u32, "UsernamePassword"), - Self::None => serializer.serialize_unit_variant("ConnectionAuthType", 3u32, "None"), - Self::Sas => serializer.serialize_unit_variant("ConnectionAuthType", 4u32, "SAS"), - Self::ServicePrincipal => serializer.serialize_unit_variant("ConnectionAuthType", 5u32, "ServicePrincipal"), - Self::AccessKey => serializer.serialize_unit_variant("ConnectionAuthType", 6u32, "AccessKey"), - Self::ApiKey => serializer.serialize_unit_variant("ConnectionAuthType", 7u32, "ApiKey"), - Self::CustomKeys => serializer.serialize_unit_variant("ConnectionAuthType", 8u32, "CustomKeys"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Category of the connection"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ConnectionCategory")] -pub enum ConnectionCategory { - PythonFeed, - ContainerRegistry, - Git, - S3, - Snowflake, - AzureSqlDb, - AzureSynapseAnalytics, - AzureMySqlDb, - AzurePostgresDb, - #[serde(rename = "ADLSGen2")] - AdlsGen2, - Redis, - ApiKey, - #[serde(rename = "AzureOpenAI")] - AzureOpenAi, - CognitiveSearch, - CognitiveService, - CustomKeys, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ConnectionCategory { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ConnectionCategory { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ConnectionCategory { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::PythonFeed => serializer.serialize_unit_variant("ConnectionCategory", 0u32, "PythonFeed"), - Self::ContainerRegistry => serializer.serialize_unit_variant("ConnectionCategory", 1u32, "ContainerRegistry"), - Self::Git => serializer.serialize_unit_variant("ConnectionCategory", 2u32, "Git"), - Self::S3 => serializer.serialize_unit_variant("ConnectionCategory", 3u32, "S3"), - Self::Snowflake => serializer.serialize_unit_variant("ConnectionCategory", 4u32, "Snowflake"), - Self::AzureSqlDb => serializer.serialize_unit_variant("ConnectionCategory", 5u32, "AzureSqlDb"), - Self::AzureSynapseAnalytics => serializer.serialize_unit_variant("ConnectionCategory", 6u32, "AzureSynapseAnalytics"), - Self::AzureMySqlDb => serializer.serialize_unit_variant("ConnectionCategory", 7u32, "AzureMySqlDb"), - Self::AzurePostgresDb => serializer.serialize_unit_variant("ConnectionCategory", 8u32, "AzurePostgresDb"), - Self::AdlsGen2 => serializer.serialize_unit_variant("ConnectionCategory", 9u32, "ADLSGen2"), - Self::Redis => serializer.serialize_unit_variant("ConnectionCategory", 10u32, "Redis"), - Self::ApiKey => serializer.serialize_unit_variant("ConnectionCategory", 11u32, "ApiKey"), - Self::AzureOpenAi => serializer.serialize_unit_variant("ConnectionCategory", 12u32, "AzureOpenAI"), - Self::CognitiveSearch => serializer.serialize_unit_variant("ConnectionCategory", 13u32, "CognitiveSearch"), - Self::CognitiveService => serializer.serialize_unit_variant("ConnectionCategory", 14u32, "CognitiveService"), - Self::CustomKeys => serializer.serialize_unit_variant("ConnectionCategory", 15u32, "CustomKeys"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Resource requirements for each container instance within an online deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ContainerResourceRequirements { - #[serde(rename = "containerResourceLimits", default, skip_serializing_if = "Option::is_none")] - pub container_resource_limits: Option, - #[serde(rename = "containerResourceRequests", default, skip_serializing_if = "Option::is_none")] - pub container_resource_requests: Option, -} -impl ContainerResourceRequirements { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ContainerResourceSettings { - #[doc = "Number of vCPUs request/limit for container. More info:\r\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cpu: Option, - #[doc = "Number of Nvidia GPU cards request/limit for container. More info:\r\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gpu: Option, - #[doc = "Memory size request/limit for container. More info:\r\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub memory: Option, -} -impl ContainerResourceSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The type of container to retrieve logs from."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ContainerType")] -pub enum ContainerType { - StorageInitializer, - InferenceServer, - ModelDataCollector, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ContainerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ContainerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ContainerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::StorageInitializer => serializer.serialize_unit_variant("ContainerType", 0u32, "StorageInitializer"), - Self::InferenceServer => serializer.serialize_unit_variant("ContainerType", 1u32, "InferenceServer"), - Self::ModelDataCollector => serializer.serialize_unit_variant("ContainerType", 2u32, "ModelDataCollector"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CosmosDbSettings { - #[serde(rename = "collectionsThroughput", default, skip_serializing_if = "Option::is_none")] - pub collections_throughput: Option, -} -impl CosmosDbSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateMonitorAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[serde(rename = "monitorDefinition")] - pub monitor_definition: MonitorDefinition, -} -impl CreateMonitorAction { - pub fn new(schedule_action_base: ScheduleActionBase, monitor_definition: MonitorDefinition) -> Self { - Self { - schedule_action_base, - monitor_definition, - } - } -} -#[doc = "Enum to determine the datastore credentials type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "CredentialsType")] -pub enum CredentialsType { - AccountKey, - Certificate, - None, - Sas, - ServicePrincipal, - KerberosKeytab, - KerberosPassword, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for CredentialsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for CredentialsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for CredentialsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AccountKey => serializer.serialize_unit_variant("CredentialsType", 0u32, "AccountKey"), - Self::Certificate => serializer.serialize_unit_variant("CredentialsType", 1u32, "Certificate"), - Self::None => serializer.serialize_unit_variant("CredentialsType", 2u32, "None"), - Self::Sas => serializer.serialize_unit_variant("CredentialsType", 3u32, "Sas"), - Self::ServicePrincipal => serializer.serialize_unit_variant("CredentialsType", 4u32, "ServicePrincipal"), - Self::KerberosKeytab => serializer.serialize_unit_variant("CredentialsType", 5u32, "KerberosKeytab"), - Self::KerberosPassword => serializer.serialize_unit_variant("CredentialsType", 6u32, "KerberosPassword"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The workflow trigger cron for ComputeStartStop schedule type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Cron { - #[doc = "The start time in yyyy-MM-ddTHH:mm:ss format."] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option, - #[doc = "[Required] Specifies cron expression of schedule.\r\nThe expression should follow NCronTab format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub expression: Option, -} -impl Cron { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CronTrigger { - #[serde(flatten)] - pub trigger_base: TriggerBase, - #[doc = "[Required] Specifies cron expression of schedule.\r\nThe expression should follow NCronTab format."] - pub expression: String, -} -impl CronTrigger { - pub fn new(trigger_base: TriggerBase, expression: String) -> Self { - Self { trigger_base, expression } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CsvExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The container name to which the labels will be exported."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The output path where the labels will be exported."] - #[serde(rename = "snapshotPath", default, skip_serializing_if = "Option::is_none")] - pub snapshot_path: Option, -} -impl CsvExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - container_name: None, - snapshot_path: None, - } - } -} -#[doc = "The desired maximum forecast horizon in units of time-series frequency."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomForecastHorizon { - #[serde(flatten)] - pub forecast_horizon: ForecastHorizon, - #[doc = "[Required] Forecast horizon value."] - pub value: i32, -} -impl CustomForecastHorizon { - pub fn new(forecast_horizon: ForecastHorizon, value: i32) -> Self { - Self { forecast_horizon, value } - } -} -#[doc = "Custom inference server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Online inference configuration options."] - #[serde(rename = "inferenceConfiguration", default, skip_serializing_if = "Option::is_none")] - pub inference_configuration: Option, -} -impl CustomInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - inference_configuration: None, - } - } -} -#[doc = "Custom Keys credential object"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CustomKeys { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub keys: Option, -} -impl CustomKeys { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Category:= CustomKeys\r\nAuthType:= CustomKeys (as type discriminator)\r\nCredentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys\r\nTarget:= {any value}\r\nUse Metadata property bag for ApiVersion and other metadata fields"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomKeysWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[doc = "Custom Keys credential object"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl CustomKeysWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomMetricThreshold { - #[doc = "[Required] The user-defined metric to calculate."] - pub metric: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl CustomMetricThreshold { - pub fn new(metric: String) -> Self { - Self { metric, threshold: None } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl CustomModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomModelJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl CustomModelJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[doc = "[Required] ARM resource ID of the component resource used to calculate the custom metrics."] - #[serde(rename = "componentId")] - pub component_id: String, - #[doc = "Monitoring assets to take as input. Key is the component input port name, value is the data asset."] - #[serde(rename = "inputAssets", default, skip_serializing_if = "Option::is_none")] - pub input_assets: Option, - #[doc = "Extra component parameters to take as input. Key is the component literal input port name, value is the parameter value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[doc = "Monitoring workspace connection definition."] - #[serde(rename = "workspaceConnection")] - pub workspace_connection: MonitoringWorkspaceConnection, -} -impl CustomMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - component_id: String, - metric_thresholds: Vec, - workspace_connection: MonitoringWorkspaceConnection, - ) -> Self { - Self { - monitoring_signal_base, - component_id, - input_assets: None, - inputs: None, - metric_thresholds, - workspace_connection, - } - } -} -#[doc = "N-Cross validations are specified by user."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomNCrossValidations { - #[serde(flatten)] - pub n_cross_validations: NCrossValidations, - #[doc = "[Required] N-Cross validations value."] - pub value: i32, -} -impl CustomNCrossValidations { - pub fn new(n_cross_validations: NCrossValidations, value: i32) -> Self { - Self { - n_cross_validations, - value, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomSeasonality { - #[serde(flatten)] - pub seasonality: Seasonality, - #[doc = "[Required] Seasonality value."] - pub value: i32, -} -impl CustomSeasonality { - pub fn new(seasonality: Seasonality, value: i32) -> Self { - Self { seasonality, value } - } -} -#[doc = "Specifies the custom service configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CustomService { - #[doc = "Name of the Custom Service"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[doc = "Environment Variable for the container"] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub docker: Option, - #[doc = "Configuring the endpoints for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoints: Vec, - #[doc = "Configuring the volumes for the container"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub volumes: Vec, -} -impl CustomService { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomTargetLags { - #[serde(flatten)] - pub target_lags: TargetLags, - #[doc = "[Required] Set target lags values."] - pub values: Vec, -} -impl CustomTargetLags { - pub fn new(target_lags: TargetLags, values: Vec) -> Self { - Self { target_lags, values } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CustomTargetRollingWindowSize { - #[serde(flatten)] - pub target_rolling_window_size: TargetRollingWindowSize, - #[doc = "[Required] TargetRollingWindowSize value."] - pub value: i32, -} -impl CustomTargetRollingWindowSize { - pub fn new(target_rolling_window_size: TargetRollingWindowSize, value: i32) -> Self { - Self { - target_rolling_window_size, - value, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DataCollectionMode")] -pub enum DataCollectionMode { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DataCollectionMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DataCollectionMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DataCollectionMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("DataCollectionMode", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("DataCollectionMode", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataCollector { - #[doc = "[Required] The collection configuration. Each collection has it own configuration to collect model data and the name of collection can be arbitrary string.\r\nModel data collector can be used for either payload logging or custom logging or both of them. Collection request and response are reserved for payload logging, others are for custom logging."] - pub collections: serde_json::Value, - #[serde(rename = "requestLogging", default, skip_serializing_if = "Option::is_none")] - pub request_logging: Option, - #[serde(rename = "rollingRate", default, skip_serializing_if = "Option::is_none")] - pub rolling_rate: Option, -} -impl DataCollector { - pub fn new(collections: serde_json::Value) -> Self { - Self { - collections, - request_logging: None, - rolling_rate: None, - } - } -} -#[doc = "Container for data asset versions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Enum to determine the type of data."] - #[serde(rename = "dataType")] - pub data_type: DataType, -} -impl DataContainer { - pub fn new(data_type: DataType) -> Self { - Self { - asset_container: AssetContainer::default(), - data_type, - } - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Container for data asset versions."] - pub properties: DataContainer, -} -impl DataContainerResource { - pub fn new(properties: DataContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of DataContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of DataContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type DataContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DataContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DataContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataDriftMetricThresholdBase { - #[serde(rename = "dataType")] - pub data_type: MonitoringFeatureDataType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl DataDriftMetricThresholdBase { - pub fn new(data_type: MonitoringFeatureDataType) -> Self { - Self { - data_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum DataDriftMetricThresholdBaseUnion { - Categorical(CategoricalDataDriftMetricThreshold), - Numerical(NumericalDataDriftMetricThreshold), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataDriftMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "dataSegment", default, skip_serializing_if = "Option::is_none")] - pub data_segment: Option, - #[doc = "A dictionary that maps feature names to their respective data types."] - #[serde(rename = "featureDataTypeOverride", default, skip_serializing_if = "Option::is_none")] - pub feature_data_type_override: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub features: Option, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "productionData")] - pub production_data: MonitoringInputDataBaseUnion, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBaseUnion, -} -impl DataDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - production_data: MonitoringInputDataBaseUnion, - reference_data: MonitoringInputDataBaseUnion, - ) -> Self { - Self { - monitoring_signal_base, - data_segment: None, - feature_data_type_override: None, - features: None, - metric_thresholds, - production_data, - reference_data, - } - } -} -#[doc = "A DataFactory compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataFactory { - #[serde(flatten)] - pub compute: Compute, -} -impl DataFactory { - pub fn new(compute: Compute) -> Self { - Self { compute } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataImport { - #[serde(flatten)] - pub data_version_base: DataVersionBase, - #[doc = "Name of the asset for data import job to create"] - #[serde(rename = "assetName", default, skip_serializing_if = "Option::is_none")] - pub asset_name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, -} -impl DataImport { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { - data_version_base, - asset_name: None, - source: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataImportSource { - #[doc = "Workspace connection for data import source storage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub connection: Option, - #[doc = "Enum to determine the type of data."] - #[serde(rename = "sourceType")] - pub source_type: DataImportSourceType, -} -impl DataImportSource { - pub fn new(source_type: DataImportSourceType) -> Self { - Self { - connection: None, - source_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "sourceType")] -pub enum DataImportSourceUnion { - #[serde(rename = "database")] - Database(DatabaseSource), - #[serde(rename = "file_system")] - FileSystem(FileSystemSource), -} -#[doc = "Enum to determine the type of data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DataImportSourceType")] -pub enum DataImportSourceType { - #[serde(rename = "database")] - Database, - #[serde(rename = "file_system")] - FileSystem, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DataImportSourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DataImportSourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DataImportSourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Database => serializer.serialize_unit_variant("DataImportSourceType", 0u32, "database"), - Self::FileSystem => serializer.serialize_unit_variant("DataImportSourceType", 1u32, "file_system"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A DataLakeAnalytics compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataLakeAnalytics { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub data_lake_analytics_schema: DataLakeAnalyticsSchema, -} -impl DataLakeAnalytics { - pub fn new(compute: Compute) -> Self { - Self { - compute, - data_lake_analytics_schema: DataLakeAnalyticsSchema::default(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataLakeAnalyticsSchema { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl DataLakeAnalyticsSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod data_lake_analytics_schema { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "DataLake Store Account Name"] - #[serde(rename = "dataLakeStoreAccountName", default, skip_serializing_if = "Option::is_none")] - pub data_lake_store_account_name: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Reference to an asset via its path in a datastore."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataPathAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "ARM resource ID of the datastore where the asset is located."] - #[serde(rename = "datastoreId", default, skip_serializing_if = "Option::is_none")] - pub datastore_id: Option, - #[doc = "The path of the file/directory in the datastore."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl DataPathAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase) -> Self { - Self { - asset_reference_base, - datastore_id: None, - path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataQualityMetricThresholdBase { - #[serde(rename = "dataType")] - pub data_type: MonitoringFeatureDataType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl DataQualityMetricThresholdBase { - pub fn new(data_type: MonitoringFeatureDataType) -> Self { - Self { - data_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum DataQualityMetricThresholdBaseUnion { - Categorical(CategoricalDataQualityMetricThreshold), - Numerical(NumericalDataQualityMetricThreshold), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataQualityMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[doc = "A dictionary that maps feature names to their respective data types."] - #[serde(rename = "featureDataTypeOverride", default, skip_serializing_if = "Option::is_none")] - pub feature_data_type_override: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub features: Option, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "productionData")] - pub production_data: MonitoringInputDataBaseUnion, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBaseUnion, -} -impl DataQualityMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - production_data: MonitoringInputDataBaseUnion, - reference_data: MonitoringInputDataBaseUnion, - ) -> Self { - Self { - monitoring_signal_base, - feature_data_type_override: None, - features: None, - metric_thresholds, - production_data, - reference_data, - } - } -} -#[doc = "Enum to determine the type of data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DataType")] -pub enum DataType { - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("DataType", 0u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("DataType", 1u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("DataType", 2u32, "mltable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Data version base definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataVersionBase { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Enum to determine the type of data."] - #[serde(rename = "dataType")] - pub data_type: DataType, - #[doc = "[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330"] - #[serde(rename = "dataUri")] - pub data_uri: String, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "Stage in the data lifecycle assigned to this data asset"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl DataVersionBase { - pub fn new(data_type: DataType, data_uri: String) -> Self { - Self { - asset_base: AssetBase::default(), - data_type, - data_uri, - intellectual_property: None, - stage: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum DataVersionBaseUnion { - #[serde(rename = "uri_folder")] - UriFolder(DataImport), - #[serde(rename = "mltable")] - Mltable(MlTableData), - #[serde(rename = "uri_file")] - UriFile(UriFileDataVersion), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderDataVersion), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataVersionBaseResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Data version base definition"] - pub properties: DataVersionBaseUnion, -} -impl DataVersionBaseResource { - pub fn new(properties: DataVersionBaseUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of DataVersionBase entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataVersionBaseResourceArmPaginatedResult { - #[doc = "The link to the next page of DataVersionBase objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type DataVersionBase."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DataVersionBaseResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DataVersionBaseResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatabaseSource { - #[serde(flatten)] - pub data_import_source: DataImportSource, - #[doc = "SQL Query statement for data import Database source"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option, - #[doc = "SQL StoredProcedure on data import Database source"] - #[serde(rename = "storedProcedure", default, skip_serializing_if = "Option::is_none")] - pub stored_procedure: Option, - #[doc = "SQL StoredProcedure parameters"] - #[serde( - rename = "storedProcedureParams", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub stored_procedure_params: Vec, - #[doc = "Name of the table on data import Database source"] - #[serde(rename = "tableName", default, skip_serializing_if = "Option::is_none")] - pub table_name: Option, -} -impl DatabaseSource { - pub fn new(data_import_source: DataImportSource) -> Self { - Self { - data_import_source, - query: None, - stored_procedure: None, - stored_procedure_params: Vec::new(), - table_name: None, - } - } -} -#[doc = "A DataFactory compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Databricks { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub databricks_schema: DatabricksSchema, -} -impl Databricks { - pub fn new(compute: Compute) -> Self { - Self { - compute, - databricks_schema: DatabricksSchema::default(), - } - } -} -#[doc = "Secrets related to a Machine Learning compute based on Databricks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatabricksComputeSecrets { - #[serde(flatten)] - pub compute_secrets: ComputeSecrets, - #[serde(flatten)] - pub databricks_compute_secrets_properties: DatabricksComputeSecretsProperties, -} -impl DatabricksComputeSecrets { - pub fn new(compute_secrets: ComputeSecrets) -> Self { - Self { - compute_secrets, - databricks_compute_secrets_properties: DatabricksComputeSecretsProperties::default(), - } - } -} -#[doc = "Properties of Databricks Compute Secrets"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabricksComputeSecretsProperties { - #[doc = "access token for databricks account."] - #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] - pub databricks_access_token: Option, -} -impl DatabricksComputeSecretsProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of Databricks"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabricksProperties { - #[doc = "Databricks access token"] - #[serde(rename = "databricksAccessToken", default, skip_serializing_if = "Option::is_none")] - pub databricks_access_token: Option, - #[doc = "Workspace Url"] - #[serde(rename = "workspaceUrl", default, skip_serializing_if = "Option::is_none")] - pub workspace_url: Option, -} -impl DatabricksProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabricksSchema { - #[doc = "Properties of Databricks"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl DatabricksSchema { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetExportSummary { - #[serde(flatten)] - pub export_summary: ExportSummary, - #[doc = "The unique name of the labeled data asset."] - #[serde(rename = "labeledAssetName", default, skip_serializing_if = "Option::is_none")] - pub labeled_asset_name: Option, -} -impl DatasetExportSummary { - pub fn new(export_summary: ExportSummary) -> Self { - Self { - export_summary, - labeled_asset_name: None, - } - } -} -#[doc = "Base definition for datastore contents configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Datastore { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "Base definition for datastore credentials."] - pub credentials: DatastoreCredentialsUnion, - #[doc = "Enum to determine the datastore contents type."] - #[serde(rename = "datastoreType")] - pub datastore_type: DatastoreType, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "Readonly property to indicate if datastore is the workspace default datastore"] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option, -} -impl Datastore { - pub fn new(credentials: DatastoreCredentialsUnion, datastore_type: DatastoreType) -> Self { - Self { - resource_base: ResourceBase::default(), - credentials, - datastore_type, - intellectual_property: None, - is_default: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "datastoreType")] -pub enum DatastoreUnion { - AzureBlob(AzureBlobDatastore), - AzureDataLakeGen1(AzureDataLakeGen1Datastore), - AzureDataLakeGen2(AzureDataLakeGen2Datastore), - AzureFile(AzureFileDatastore), - Hdfs(HdfsDatastore), - OneLake(OneLakeDatastore), -} -#[doc = "Base definition for datastore credentials."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatastoreCredentials { - #[doc = "Enum to determine the datastore credentials type."] - #[serde(rename = "credentialsType")] - pub credentials_type: CredentialsType, -} -impl DatastoreCredentials { - pub fn new(credentials_type: CredentialsType) -> Self { - Self { credentials_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "credentialsType")] -pub enum DatastoreCredentialsUnion { - AccountKey(AccountKeyDatastoreCredentials), - Certificate(CertificateDatastoreCredentials), - KerberosKeytab(KerberosKeytabCredentials), - KerberosPassword(KerberosPasswordCredentials), - None(NoneDatastoreCredentials), - Sas(SasDatastoreCredentials), - ServicePrincipal(ServicePrincipalDatastoreCredentials), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatastoreResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Base definition for datastore contents configuration."] - pub properties: DatastoreUnion, -} -impl DatastoreResource { - pub fn new(properties: DatastoreUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of Datastore entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatastoreResourceArmPaginatedResult { - #[doc = "The link to the next page of Datastore objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Datastore."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DatastoreResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl DatastoreResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Base definition for datastore secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatastoreSecrets { - #[doc = "Enum to determine the datastore secrets type."] - #[serde(rename = "secretsType")] - pub secrets_type: SecretsType, -} -impl DatastoreSecrets { - pub fn new(secrets_type: SecretsType) -> Self { - Self { secrets_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "secretsType")] -pub enum DatastoreSecretsUnion { - AccountKey(AccountKeyDatastoreSecrets), - Certificate(CertificateDatastoreSecrets), - KerberosKeytab(KerberosKeytabSecrets), - KerberosPassword(KerberosPasswordSecrets), - Sas(SasDatastoreSecrets), - ServicePrincipal(ServicePrincipalDatastoreSecrets), -} -#[doc = "Enum to determine the datastore contents type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DatastoreType")] -pub enum DatastoreType { - AzureBlob, - AzureDataLakeGen1, - AzureDataLakeGen2, - AzureFile, - Hdfs, - OneLake, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DatastoreType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DatastoreType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DatastoreType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureBlob => serializer.serialize_unit_variant("DatastoreType", 0u32, "AzureBlob"), - Self::AzureDataLakeGen1 => serializer.serialize_unit_variant("DatastoreType", 1u32, "AzureDataLakeGen1"), - Self::AzureDataLakeGen2 => serializer.serialize_unit_variant("DatastoreType", 2u32, "AzureDataLakeGen2"), - Self::AzureFile => serializer.serialize_unit_variant("DatastoreType", 3u32, "AzureFile"), - Self::Hdfs => serializer.serialize_unit_variant("DatastoreType", 4u32, "Hdfs"), - Self::OneLake => serializer.serialize_unit_variant("DatastoreType", 5u32, "OneLake"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefaultScaleSettings { - #[serde(flatten)] - pub online_scale_settings: OnlineScaleSettings, -} -impl DefaultScaleSettings { - pub fn new(online_scale_settings: OnlineScaleSettings) -> Self { - Self { online_scale_settings } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeploymentLogs { - #[doc = "The retrieved online deployment logs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option, -} -impl DeploymentLogs { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeploymentLogsRequest { - #[doc = "The type of container to retrieve logs from."] - #[serde(rename = "containerType", default, skip_serializing_if = "Option::is_none")] - pub container_type: Option, - #[doc = "The maximum number of lines to tail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tail: Option, -} -impl DeploymentLogsRequest { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Possible values for DeploymentProvisioningState."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DeploymentProvisioningState")] -pub enum DeploymentProvisioningState { - Creating, - Deleting, - Scaling, - Updating, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DeploymentProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DeploymentProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DeploymentProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("DeploymentProvisioningState", 0u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("DeploymentProvisioningState", 1u32, "Deleting"), - Self::Scaling => serializer.serialize_unit_variant("DeploymentProvisioningState", 2u32, "Scaling"), - Self::Updating => serializer.serialize_unit_variant("DeploymentProvisioningState", 3u32, "Updating"), - Self::Succeeded => serializer.serialize_unit_variant("DeploymentProvisioningState", 4u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("DeploymentProvisioningState", 5u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("DeploymentProvisioningState", 6u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeploymentResourceConfiguration { - #[serde(flatten)] - pub resource_configuration: ResourceConfiguration, -} -impl DeploymentResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseRequestProperties { - #[doc = "Setting for diagnosing dependent application insights"] - #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] - pub application_insights: Option, - #[doc = "Setting for diagnosing dependent container registry"] - #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] - pub container_registry: Option, - #[doc = "Setting for diagnosing dns resolution"] - #[serde(rename = "dnsResolution", default, skip_serializing_if = "Option::is_none")] - pub dns_resolution: Option, - #[doc = "Setting for diagnosing dependent key vault"] - #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] - pub key_vault: Option, - #[doc = "Setting for diagnosing network security group"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nsg: Option, - #[doc = "Setting for diagnosing unclassified category of problems"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub others: Option, - #[doc = "Setting for diagnosing resource lock"] - #[serde(rename = "resourceLock", default, skip_serializing_if = "Option::is_none")] - pub resource_lock: Option, - #[doc = "Setting for diagnosing dependent storage account"] - #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] - pub storage_account: Option, - #[doc = "Setting for diagnosing user defined routing"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub udr: Option, -} -impl DiagnoseRequestProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseResponseResult { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl DiagnoseResponseResult { - pub fn new() -> Self { - Self::default() - } -} -pub mod diagnose_response_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Value { - #[serde( - rename = "userDefinedRouteResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub user_defined_route_results: Vec, - #[serde( - rename = "networkSecurityRuleResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub network_security_rule_results: Vec, - #[serde( - rename = "resourceLockResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub resource_lock_results: Vec, - #[serde( - rename = "dnsResolutionResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub dns_resolution_results: Vec, - #[serde( - rename = "storageAccountResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub storage_account_results: Vec, - #[serde( - rename = "keyVaultResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub key_vault_results: Vec, - #[serde( - rename = "containerRegistryResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub container_registry_results: Vec, - #[serde( - rename = "applicationInsightsResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub application_insights_results: Vec, - #[serde( - rename = "otherResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub other_results: Vec, - } - impl Value { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Result of Diagnose"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseResult { - #[doc = "Code for workspace setup error"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Level of workspace setup error"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "Message of workspace setup error"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl DiagnoseResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Level of workspace setup error"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DiagnoseResultLevel")] -pub enum DiagnoseResultLevel { - Warning, - Error, - Information, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DiagnoseResultLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DiagnoseResultLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DiagnoseResultLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Warning => serializer.serialize_unit_variant("DiagnoseResultLevel", 0u32, "Warning"), - Self::Error => serializer.serialize_unit_variant("DiagnoseResultLevel", 1u32, "Error"), - Self::Information => serializer.serialize_unit_variant("DiagnoseResultLevel", 2u32, "Information"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Parameters to diagnose a workspace"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DiagnoseWorkspaceParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl DiagnoseWorkspaceParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Base definition for job distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DistributionConfiguration { - #[doc = "Enum to determine the job distribution type."] - #[serde(rename = "distributionType")] - pub distribution_type: DistributionType, -} -impl DistributionConfiguration { - pub fn new(distribution_type: DistributionType) -> Self { - Self { distribution_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "distributionType")] -pub enum DistributionConfigurationUnion { - Mpi(Mpi), - PyTorch(PyTorch), - Ray(Ray), - TensorFlow(TensorFlow), -} -#[doc = "Enum to determine the job distribution type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "DistributionType")] -pub enum DistributionType { - PyTorch, - TensorFlow, - Mpi, - Ray, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for DistributionType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for DistributionType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for DistributionType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::PyTorch => serializer.serialize_unit_variant("DistributionType", 0u32, "PyTorch"), - Self::TensorFlow => serializer.serialize_unit_variant("DistributionType", 1u32, "TensorFlow"), - Self::Mpi => serializer.serialize_unit_variant("DistributionType", 2u32, "Mpi"), - Self::Ray => serializer.serialize_unit_variant("DistributionType", 3u32, "Ray"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Docker { - #[doc = "Indicate whether container shall run in privileged or non-privileged mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub privileged: Option, -} -impl Docker { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Early termination policies enable canceling poor-performing runs before they complete"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EarlyTerminationPolicy { - #[doc = "Number of intervals by which to delay the first evaluation."] - #[serde(rename = "delayEvaluation", default, skip_serializing_if = "Option::is_none")] - pub delay_evaluation: Option, - #[doc = "Interval (number of runs) between policy evaluations."] - #[serde(rename = "evaluationInterval", default, skip_serializing_if = "Option::is_none")] - pub evaluation_interval: Option, - #[serde(rename = "policyType")] - pub policy_type: EarlyTerminationPolicyType, -} -impl EarlyTerminationPolicy { - pub fn new(policy_type: EarlyTerminationPolicyType) -> Self { - Self { - delay_evaluation: None, - evaluation_interval: None, - policy_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "policyType")] -pub enum EarlyTerminationPolicyUnion { - Bandit(BanditPolicy), - MedianStopping(MedianStoppingPolicy), - TruncationSelection(TruncationSelectionPolicy), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EarlyTerminationPolicyType")] -pub enum EarlyTerminationPolicyType { - Bandit, - MedianStopping, - TruncationSelection, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EarlyTerminationPolicyType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EarlyTerminationPolicyType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EarlyTerminationPolicyType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bandit => serializer.serialize_unit_variant("EarlyTerminationPolicyType", 0u32, "Bandit"), - Self::MedianStopping => serializer.serialize_unit_variant("EarlyTerminationPolicyType", 1u32, "MedianStopping"), - Self::TruncationSelection => serializer.serialize_unit_variant("EarlyTerminationPolicyType", 2u32, "TruncationSelection"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EgressPublicNetworkAccessType")] -pub enum EgressPublicNetworkAccessType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EgressPublicNetworkAccessType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EgressPublicNetworkAccessType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EgressPublicNetworkAccessType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("EgressPublicNetworkAccessType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("EgressPublicNetworkAccessType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EmailMonitoringAlertNotificationSettings { - #[serde(flatten)] - pub monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase, - #[doc = "Configuration for notification."] - #[serde(rename = "emailNotificationSetting", default, skip_serializing_if = "Option::is_none")] - pub email_notification_setting: Option, -} -impl EmailMonitoringAlertNotificationSettings { - pub fn new(monitoring_alert_notification_settings_base: MonitoringAlertNotificationSettingsBase) -> Self { - Self { - monitoring_alert_notification_settings_base, - email_notification_setting: None, - } - } -} -#[doc = "Enum to determine the email notification type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EmailNotificationEnableType")] -pub enum EmailNotificationEnableType { - JobCompleted, - JobFailed, - JobCancelled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EmailNotificationEnableType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EmailNotificationEnableType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EmailNotificationEnableType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JobCompleted => serializer.serialize_unit_variant("EmailNotificationEnableType", 0u32, "JobCompleted"), - Self::JobFailed => serializer.serialize_unit_variant("EmailNotificationEnableType", 1u32, "JobFailed"), - Self::JobCancelled => serializer.serialize_unit_variant("EmailNotificationEnableType", 2u32, "JobCancelled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionKeyVaultUpdateProperties { - #[serde(rename = "keyIdentifier")] - pub key_identifier: String, -} -impl EncryptionKeyVaultUpdateProperties { - pub fn new(key_identifier: String) -> Self { - Self { key_identifier } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionProperty { - #[doc = "The byok cosmosdb account that customer brings to store customer's data\r\nwith encryption"] - #[serde(rename = "cosmosDbResourceId", default, skip_serializing_if = "Option::is_none")] - pub cosmos_db_resource_id: Option, - #[doc = "Identity object used for encryption."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Customer Key vault properties."] - #[serde(rename = "keyVaultProperties")] - pub key_vault_properties: KeyVaultProperties, - #[doc = "The byok search account that customer brings to store customer's data\r\nwith encryption"] - #[serde(rename = "searchAccountResourceId", default, skip_serializing_if = "Option::is_none")] - pub search_account_resource_id: Option, - #[doc = "Indicates whether or not the encryption is enabled for the workspace."] - pub status: EncryptionStatus, - #[doc = "The byok storage account that customer brings to store customer's data\r\nwith encryption"] - #[serde(rename = "storageAccountResourceId", default, skip_serializing_if = "Option::is_none")] - pub storage_account_resource_id: Option, -} -impl EncryptionProperty { - pub fn new(key_vault_properties: KeyVaultProperties, status: EncryptionStatus) -> Self { - Self { - cosmos_db_resource_id: None, - identity: None, - key_vault_properties, - search_account_resource_id: None, - status, - storage_account_resource_id: None, - } - } -} -#[doc = "Indicates whether or not the encryption is enabled for the workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EncryptionStatus")] -pub enum EncryptionStatus { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EncryptionStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EncryptionStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EncryptionStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("EncryptionStatus", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("EncryptionStatus", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EncryptionUpdateProperties { - #[serde(rename = "keyVaultProperties")] - pub key_vault_properties: EncryptionKeyVaultUpdateProperties, -} -impl EncryptionUpdateProperties { - pub fn new(key_vault_properties: EncryptionKeyVaultUpdateProperties) -> Self { - Self { key_vault_properties } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Endpoint { - #[doc = "Protocol over which communication will happen over this endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[doc = "Name of the Endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Application port inside the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Port over which the application is exposed from container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub published: Option, - #[doc = "Host IP over which the application is exposed from the container"] - #[serde(rename = "hostIp", default, skip_serializing_if = "Option::is_none")] - pub host_ip: Option, -} -impl Endpoint { - pub fn new() -> Self { - Self::default() - } -} -pub mod endpoint { - use super::*; - #[doc = "Protocol over which communication will happen over this endpoint"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Protocol")] - pub enum Protocol { - #[serde(rename = "tcp")] - Tcp, - #[serde(rename = "udp")] - Udp, - #[serde(rename = "http")] - Http, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Protocol { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Protocol { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Protocol { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "tcp"), - Self::Udp => serializer.serialize_unit_variant("Protocol", 1u32, "udp"), - Self::Http => serializer.serialize_unit_variant("Protocol", 2u32, "http"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Protocol { - fn default() -> Self { - Self::Tcp - } - } -} -#[doc = "Keys for endpoint authentication."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EndpointAuthKeys { - #[doc = "The primary key."] - #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] - pub primary_key: Option, - #[doc = "The secondary key."] - #[serde(rename = "secondaryKey", default, skip_serializing_if = "Option::is_none")] - pub secondary_key: Option, -} -impl EndpointAuthKeys { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to determine endpoint authentication mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointAuthMode")] -pub enum EndpointAuthMode { - #[serde(rename = "AMLToken")] - AmlToken, - Key, - #[serde(rename = "AADToken")] - AadToken, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointAuthMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointAuthMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointAuthMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AmlToken => serializer.serialize_unit_variant("EndpointAuthMode", 0u32, "AMLToken"), - Self::Key => serializer.serialize_unit_variant("EndpointAuthMode", 1u32, "Key"), - Self::AadToken => serializer.serialize_unit_variant("EndpointAuthMode", 2u32, "AADToken"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Service Token"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EndpointAuthToken { - #[doc = "Access token for endpoint authentication."] - #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, - #[doc = "Access token expiry time (UTC)."] - #[serde(rename = "expiryTimeUtc", default, skip_serializing_if = "Option::is_none")] - pub expiry_time_utc: Option, - #[doc = "Refresh access token after time (UTC)."] - #[serde(rename = "refreshAfterTimeUtc", default, skip_serializing_if = "Option::is_none")] - pub refresh_after_time_utc: Option, - #[doc = "Access token type."] - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option, -} -impl EndpointAuthToken { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to determine endpoint compute type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointComputeType")] -pub enum EndpointComputeType { - Managed, - Kubernetes, - #[serde(rename = "AzureMLCompute")] - AzureMlCompute, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointComputeType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointComputeType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointComputeType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Managed => serializer.serialize_unit_variant("EndpointComputeType", 0u32, "Managed"), - Self::Kubernetes => serializer.serialize_unit_variant("EndpointComputeType", 1u32, "Kubernetes"), - Self::AzureMlCompute => serializer.serialize_unit_variant("EndpointComputeType", 2u32, "AzureMLCompute"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition for endpoint deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EndpointDeploymentPropertiesBase { - #[doc = "Configuration for a scoring code asset."] - #[serde(rename = "codeConfiguration", default, skip_serializing_if = "Option::is_none")] - pub code_configuration: Option, - #[doc = "Description of the endpoint deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "ARM resource ID of the environment specification for the endpoint deployment."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Environment variables configuration for the deployment."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "Property dictionary. Properties can be added, but not removed or altered."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl EndpointDeploymentPropertiesBase { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Inference Endpoint base definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointPropertiesBase { - #[doc = "Enum to determine endpoint authentication mode."] - #[serde(rename = "authMode")] - pub auth_mode: EndpointAuthMode, - #[doc = "Description of the inference endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Keys for endpoint authentication."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub keys: Option, - #[doc = "Property dictionary. Properties can be added, but not removed or altered."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Endpoint URI."] - #[serde(rename = "scoringUri", default, skip_serializing_if = "Option::is_none")] - pub scoring_uri: Option, - #[doc = "Endpoint Swagger URI."] - #[serde(rename = "swaggerUri", default, skip_serializing_if = "Option::is_none")] - pub swagger_uri: Option, -} -impl EndpointPropertiesBase { - pub fn new(auth_mode: EndpointAuthMode) -> Self { - Self { - auth_mode, - description: None, - keys: None, - properties: None, - scoring_uri: None, - swagger_uri: None, - } - } -} -#[doc = "State of endpoint provisioning."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointProvisioningState")] -pub enum EndpointProvisioningState { - Creating, - Deleting, - Succeeded, - Failed, - Updating, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("EndpointProvisioningState", 0u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("EndpointProvisioningState", 1u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("EndpointProvisioningState", 2u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("EndpointProvisioningState", 3u32, "Failed"), - Self::Updating => serializer.serialize_unit_variant("EndpointProvisioningState", 4u32, "Updating"), - Self::Canceled => serializer.serialize_unit_variant("EndpointProvisioningState", 5u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointScheduleAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[doc = "[Required] Defines Schedule action definition details.\r\n"] - #[serde(rename = "endpointInvocationDefinition")] - pub endpoint_invocation_definition: serde_json::Value, -} -impl EndpointScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, endpoint_invocation_definition: serde_json::Value) -> Self { - Self { - schedule_action_base, - endpoint_invocation_definition, - } - } -} -#[doc = "Connection status of the service consumer with the service provider"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EndpointServiceConnectionStatus")] -pub enum EndpointServiceConnectionStatus { - Approved, - Pending, - Rejected, - Disconnected, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EndpointServiceConnectionStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EndpointServiceConnectionStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EndpointServiceConnectionStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Approved => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 0u32, "Approved"), - Self::Pending => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 1u32, "Pending"), - Self::Rejected => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 2u32, "Rejected"), - Self::Disconnected => serializer.serialize_unit_variant("EndpointServiceConnectionStatus", 3u32, "Disconnected"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Container for environment specification versions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl EnvironmentContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnvironmentContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Container for environment specification versions."] - pub properties: EnvironmentContainer, -} -impl EnvironmentContainerResource { - pub fn new(properties: EnvironmentContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of EnvironmentContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of EnvironmentContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type EnvironmentContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for EnvironmentContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl EnvironmentContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Environment type is either user created or curated by Azure ML service"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EnvironmentType")] -pub enum EnvironmentType { - Curated, - UserCreated, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for EnvironmentType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for EnvironmentType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for EnvironmentType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Curated => serializer.serialize_unit_variant("EnvironmentType", 0u32, "Curated"), - Self::UserCreated => serializer.serialize_unit_variant("EnvironmentType", 1u32, "UserCreated"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVariable { - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Value of the Environment variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl EnvironmentVariable { - pub fn new() -> Self { - Self::default() - } -} -pub mod environment_variable { - use super::*; - #[doc = "Type of the Environment Variable. Possible values are: local - For local variable"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "local")] - Local, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Local => serializer.serialize_unit_variant("Type", 0u32, "local"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Local - } - } -} -#[doc = "Environment version details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "AutoRebuild setting for the derived image"] - #[serde(rename = "autoRebuild", default, skip_serializing_if = "Option::is_none")] - pub auto_rebuild: Option, - #[doc = "Configuration settings for Docker build context"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option, - #[doc = "Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages.\r\n"] - #[serde(rename = "condaFile", default, skip_serializing_if = "Option::is_none")] - pub conda_file: Option, - #[doc = "Environment type is either user created or curated by Azure ML service"] - #[serde(rename = "environmentType", default, skip_serializing_if = "Option::is_none")] - pub environment_type: Option, - #[doc = "Name of the image that will be used for the environment.\r\n"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, - #[serde(rename = "inferenceConfig", default, skip_serializing_if = "Option::is_none")] - pub inference_config: Option, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "The type of operating system."] - #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] - pub os_type: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Stage in the environment lifecycle assigned to this environment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl EnvironmentVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnvironmentVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Environment version details."] - pub properties: EnvironmentVersion, -} -impl EnvironmentVersionResource { - pub fn new(properties: EnvironmentVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of EnvironmentVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of EnvironmentVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type EnvironmentVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for EnvironmentVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl EnvironmentVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorDetail { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl ErrorDetail { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for ErrorResponse { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The estimated price info for using a VM of a particular OS type, tier, etc."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EstimatedVmPrice { - #[doc = "The price charged for using the VM."] - #[serde(rename = "retailPrice")] - pub retail_price: f64, - #[doc = "Operating system type used by the VM."] - #[serde(rename = "osType")] - pub os_type: estimated_vm_price::OsType, - #[doc = "The type of the VM."] - #[serde(rename = "vmTier")] - pub vm_tier: estimated_vm_price::VmTier, -} -impl EstimatedVmPrice { - pub fn new(retail_price: f64, os_type: estimated_vm_price::OsType, vm_tier: estimated_vm_price::VmTier) -> Self { - Self { - retail_price, - os_type, - vm_tier, - } - } -} -pub mod estimated_vm_price { - use super::*; - #[doc = "Operating system type used by the VM."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OsType")] - pub enum OsType { - Linux, - Windows, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Linux => serializer.serialize_unit_variant("OsType", 0u32, "Linux"), - Self::Windows => serializer.serialize_unit_variant("OsType", 1u32, "Windows"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of the VM."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "VmTier")] - pub enum VmTier { - Standard, - LowPriority, - Spot, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for VmTier { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for VmTier { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for VmTier { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Standard => serializer.serialize_unit_variant("VmTier", 0u32, "Standard"), - Self::LowPriority => serializer.serialize_unit_variant("VmTier", 1u32, "LowPriority"), - Self::Spot => serializer.serialize_unit_variant("VmTier", 2u32, "Spot"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The estimated price info for using a VM."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EstimatedVmPrices { - #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] - #[serde(rename = "billingCurrency")] - pub billing_currency: estimated_vm_prices::BillingCurrency, - #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] - #[serde(rename = "unitOfMeasure")] - pub unit_of_measure: estimated_vm_prices::UnitOfMeasure, - #[doc = "The list of estimated prices for using a VM of a particular OS type, tier, etc."] - pub values: Vec, -} -impl EstimatedVmPrices { - pub fn new( - billing_currency: estimated_vm_prices::BillingCurrency, - unit_of_measure: estimated_vm_prices::UnitOfMeasure, - values: Vec, - ) -> Self { - Self { - billing_currency, - unit_of_measure, - values, - } - } -} -pub mod estimated_vm_prices { - use super::*; - #[doc = "Three lettered code specifying the currency of the VM price. Example: USD"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "BillingCurrency")] - pub enum BillingCurrency { - #[serde(rename = "USD")] - Usd, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for BillingCurrency { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for BillingCurrency { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for BillingCurrency { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Usd => serializer.serialize_unit_variant("BillingCurrency", 0u32, "USD"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The unit of time measurement for the specified VM price. Example: OneHour"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "UnitOfMeasure")] - pub enum UnitOfMeasure { - OneHour, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for UnitOfMeasure { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for UnitOfMeasure { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for UnitOfMeasure { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::OneHour => serializer.serialize_unit_variant("UnitOfMeasure", 0u32, "OneHour"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The format of exported labels."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ExportFormatType")] -pub enum ExportFormatType { - Dataset, - Coco, - #[serde(rename = "CSV")] - Csv, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ExportFormatType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ExportFormatType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ExportFormatType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dataset => serializer.serialize_unit_variant("ExportFormatType", 0u32, "Dataset"), - Self::Coco => serializer.serialize_unit_variant("ExportFormatType", 1u32, "Coco"), - Self::Csv => serializer.serialize_unit_variant("ExportFormatType", 2u32, "CSV"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportSummary { - #[doc = "The time when the export was completed."] - #[serde(rename = "endDateTime", default, with = "azure_core::date::rfc3339::option")] - pub end_date_time: Option, - #[doc = "The total number of labeled datapoints exported."] - #[serde(rename = "exportedRowCount", default, skip_serializing_if = "Option::is_none")] - pub exported_row_count: Option, - #[doc = "The format of exported labels."] - pub format: ExportFormatType, - #[doc = "Name and identifier of the job containing exported labels."] - #[serde(rename = "labelingJobId", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_id: Option, - #[doc = "The time when the export was requested."] - #[serde(rename = "startDateTime", default, with = "azure_core::date::rfc3339::option")] - pub start_date_time: Option, -} -impl ExportSummary { - pub fn new(format: ExportFormatType) -> Self { - Self { - end_date_time: None, - exported_row_count: None, - format, - labeling_job_id: None, - start_date_time: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "format")] -pub enum ExportSummaryUnion { - Coco(CocoExportSummary), - #[serde(rename = "CSV")] - Csv(CsvExportSummary), - Dataset(DatasetExportSummary), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExternalFqdnResponse { - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl ExternalFqdnResponse { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpoint { - #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] - pub domain_name: Option, - #[serde( - rename = "endpointDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoint_details: Vec, -} -impl FqdnEndpoint { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpointDetail { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, -} -impl FqdnEndpointDetail { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpoints { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub endpoints: Vec, -} -impl FqdnEndpoints { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Property bag for FQDN endpoints result"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FqdnEndpointsPropertyBag { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl FqdnEndpointsPropertyBag { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Feature { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option, - #[doc = "Specifies name"] - #[serde(rename = "featureName", default, skip_serializing_if = "Option::is_none")] - pub feature_name: Option, -} -impl Feature { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureAttributionDriftMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "metricThreshold")] - pub metric_threshold: FeatureAttributionMetricThreshold, - #[doc = "[Required] The data which drift will be calculated for."] - #[serde(rename = "productionData")] - pub production_data: Vec, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBaseUnion, -} -impl FeatureAttributionDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_threshold: FeatureAttributionMetricThreshold, - production_data: Vec, - reference_data: MonitoringInputDataBaseUnion, - ) -> Self { - Self { - monitoring_signal_base, - metric_threshold, - production_data, - reference_data, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureAttributionMetric")] -pub enum FeatureAttributionMetric { - NormalizedDiscountedCumulativeGain, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeatureAttributionMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeatureAttributionMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeatureAttributionMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NormalizedDiscountedCumulativeGain => { - serializer.serialize_unit_variant("FeatureAttributionMetric", 0u32, "NormalizedDiscountedCumulativeGain") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureAttributionMetricThreshold { - pub metric: FeatureAttributionMetric, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl FeatureAttributionMetricThreshold { - pub fn new(metric: FeatureAttributionMetric) -> Self { - Self { metric, threshold: None } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureDataType")] -pub enum FeatureDataType { - String, - Integer, - Long, - Float, - Double, - Binary, - Datetime, - Boolean, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeatureDataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeatureDataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeatureDataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::String => serializer.serialize_unit_variant("FeatureDataType", 0u32, "String"), - Self::Integer => serializer.serialize_unit_variant("FeatureDataType", 1u32, "Integer"), - Self::Long => serializer.serialize_unit_variant("FeatureDataType", 2u32, "Long"), - Self::Float => serializer.serialize_unit_variant("FeatureDataType", 3u32, "Float"), - Self::Double => serializer.serialize_unit_variant("FeatureDataType", 4u32, "Double"), - Self::Binary => serializer.serialize_unit_variant("FeatureDataType", 5u32, "Binary"), - Self::Datetime => serializer.serialize_unit_variant("FeatureDataType", 6u32, "Datetime"), - Self::Boolean => serializer.serialize_unit_variant("FeatureDataType", 7u32, "Boolean"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Flag for generating lags for the numeric features."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeatureLags")] -pub enum FeatureLags { - None, - Auto, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeatureLags { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeatureLags { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeatureLags { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("FeatureLags", 0u32, "None"), - Self::Auto => serializer.serialize_unit_variant("FeatureLags", 1u32, "Auto"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature"] - pub properties: Feature, -} -impl FeatureResource { - pub fn new(properties: Feature) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of Feature entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureResourceArmPaginatedResult { - #[doc = "The link to the next page of Feature objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Feature."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeatureResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeatureResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureStoreSettings { - #[serde(rename = "computeRuntime", default, skip_serializing_if = "Option::is_none")] - pub compute_runtime: Option, - #[serde(rename = "offlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub offline_store_connection_name: Option, - #[serde(rename = "onlineStoreConnectionName", default, skip_serializing_if = "Option::is_none")] - pub online_store_connection_name: Option, -} -impl FeatureStoreSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeatureSubset { - #[serde(flatten)] - pub monitoring_feature_filter_base: MonitoringFeatureFilterBase, - #[doc = "[Required] The list of features to include."] - pub features: Vec, -} -impl FeatureSubset { - pub fn new(monitoring_feature_filter_base: MonitoringFeatureFilterBase, features: Vec) -> Self { - Self { - monitoring_feature_filter_base, - features, - } - } -} -#[doc = "Specifies the feature window"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureWindow { - #[doc = "Specifies the feature window end time"] - #[serde(rename = "featureWindowEnd", default, with = "azure_core::date::rfc3339::option")] - pub feature_window_end: Option, - #[doc = "Specifies the feature window start time"] - #[serde(rename = "featureWindowStart", default, with = "azure_core::date::rfc3339::option")] - pub feature_window_start: Option, -} -impl FeatureWindow { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature set"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl FeaturesetContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturesetContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature set"] - pub properties: FeaturesetContainer, -} -impl FeaturesetContainerResource { - pub fn new(properties: FeaturesetContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturesetContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing the feature set job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetJob { - #[doc = "Specifies the created date"] - #[serde(rename = "createdDate", default, with = "azure_core::date::rfc3339::option")] - pub created_date: Option, - #[doc = "Specifies the display name"] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Specifies the duration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option, - #[doc = "Specifies the experiment id"] - #[serde(rename = "experimentId", default, skip_serializing_if = "Option::is_none")] - pub experiment_id: Option, - #[doc = "Specifies the feature window"] - #[serde(rename = "featureWindow", default, skip_serializing_if = "Option::is_none")] - pub feature_window: Option, - #[doc = "Specifies the job id"] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "The status of a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Specifies the tags if any"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl FeaturesetJob { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A paginated list of FeaturesetJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetJobArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetJobArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetJobArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing specification"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetSpecification { - #[doc = "Specifies the spec path"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl FeaturesetSpecification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Specifies list of entities"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub entities: Vec, - #[serde(rename = "materializationSettings", default, skip_serializing_if = "Option::is_none")] - pub materialization_settings: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Dto object representing specification"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub specification: Option, - #[doc = "Specifies the asset stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl FeaturesetVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Request payload for creating a backfill request for a given feature set version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersionBackfillRequest { - #[doc = "Specifies description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Specifies description"] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Specifies the feature window"] - #[serde(rename = "featureWindow", default, skip_serializing_if = "Option::is_none")] - pub feature_window: Option, - #[doc = "Dto object representing compute resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[doc = "Specifies the spark compute settings"] - #[serde(rename = "sparkConfiguration", default, skip_serializing_if = "Option::is_none")] - pub spark_configuration: Option, - #[doc = "Specifies the tags"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl FeaturesetVersionBackfillRequest { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturesetVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature set version"] - pub properties: FeaturesetVersion, -} -impl FeaturesetVersionResource { - pub fn new(properties: FeaturesetVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturesetVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturesetVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturesetVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturesetVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturesetVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturesetVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl FeaturestoreEntityContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturestoreEntityContainerResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature entity"] - pub properties: FeaturestoreEntityContainer, -} -impl FeaturestoreEntityContainerResource { - pub fn new(properties: FeaturestoreEntityContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturestoreEntityContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturestoreEntityContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturestoreEntityContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturestoreEntityContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturestoreEntityContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Dto object representing feature entity version"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Specifies index columns"] - #[serde( - rename = "indexColumns", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub index_columns: Vec, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Specifies the asset stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl FeaturestoreEntityVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FeaturestoreEntityVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Dto object representing feature entity version"] - pub properties: FeaturestoreEntityVersion, -} -impl FeaturestoreEntityVersionResource { - pub fn new(properties: FeaturestoreEntityVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of FeaturestoreEntityVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturestoreEntityVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of FeaturestoreEntityVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type FeaturestoreEntityVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for FeaturestoreEntityVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl FeaturestoreEntityVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeaturestoreJobType")] -pub enum FeaturestoreJobType { - RecurrentMaterialization, - BackfillMaterialization, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeaturestoreJobType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeaturestoreJobType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeaturestoreJobType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::RecurrentMaterialization => serializer.serialize_unit_variant("FeaturestoreJobType", 0u32, "RecurrentMaterialization"), - Self::BackfillMaterialization => serializer.serialize_unit_variant("FeaturestoreJobType", 1u32, "BackfillMaterialization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Featurization mode - determines data featurization mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FeaturizationMode")] -pub enum FeaturizationMode { - Auto, - Custom, - Off, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FeaturizationMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FeaturizationMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FeaturizationMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("FeaturizationMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("FeaturizationMode", 1u32, "Custom"), - Self::Off => serializer.serialize_unit_variant("FeaturizationMode", 2u32, "Off"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Featurization Configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeaturizationSettings { - #[doc = "Dataset language, useful for the text data."] - #[serde(rename = "datasetLanguage", default, skip_serializing_if = "Option::is_none")] - pub dataset_language: Option, -} -impl FeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FileSystemSource { - #[serde(flatten)] - pub data_import_source: DataImportSource, - #[doc = "Path on data import FileSystem source"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl FileSystemSource { - pub fn new(data_import_source: DataImportSource) -> Self { - Self { - data_import_source, - path: None, - } - } -} -#[doc = "Fixed input data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FixedInputData { - #[serde(flatten)] - pub monitoring_input_data_base: MonitoringInputDataBase, -} -impl FixedInputData { - pub fn new(monitoring_input_data_base: MonitoringInputDataBase) -> Self { - Self { - monitoring_input_data_base, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FlavorData { - #[doc = "Model flavor-specific data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option, -} -impl FlavorData { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The desired maximum forecast horizon in units of time-series frequency."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ForecastHorizon { - #[doc = "Enum to determine forecast horizon selection mode."] - pub mode: ForecastHorizonMode, -} -impl ForecastHorizon { - pub fn new(mode: ForecastHorizonMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum ForecastHorizonUnion { - Auto(AutoForecastHorizon), - Custom(CustomForecastHorizon), -} -#[doc = "Enum to determine forecast horizon selection mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastHorizonMode")] -pub enum ForecastHorizonMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ForecastHorizonMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ForecastHorizonMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ForecastHorizonMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("ForecastHorizonMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("ForecastHorizonMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Forecasting task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Forecasting { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Forecasting specific parameters."] - #[serde(rename = "forecastingSettings", default, skip_serializing_if = "Option::is_none")] - pub forecasting_settings: Option, - #[doc = "Primary metrics for Forecasting task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Forecasting Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Forecasting { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - forecasting_settings: None, - primary_metric: None, - training_settings: None, - } - } -} -#[doc = "Enum for all forecasting models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastingModels")] -pub enum ForecastingModels { - AutoArima, - Prophet, - Naive, - SeasonalNaive, - Average, - SeasonalAverage, - ExponentialSmoothing, - Arimax, - #[serde(rename = "TCNForecaster")] - TcnForecaster, - ElasticNet, - GradientBoosting, - DecisionTree, - #[serde(rename = "KNN")] - Knn, - LassoLars, - #[serde(rename = "SGD")] - Sgd, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - #[serde(rename = "XGBoostRegressor")] - XgBoostRegressor, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ForecastingModels { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ForecastingModels { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ForecastingModels { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AutoArima => serializer.serialize_unit_variant("ForecastingModels", 0u32, "AutoArima"), - Self::Prophet => serializer.serialize_unit_variant("ForecastingModels", 1u32, "Prophet"), - Self::Naive => serializer.serialize_unit_variant("ForecastingModels", 2u32, "Naive"), - Self::SeasonalNaive => serializer.serialize_unit_variant("ForecastingModels", 3u32, "SeasonalNaive"), - Self::Average => serializer.serialize_unit_variant("ForecastingModels", 4u32, "Average"), - Self::SeasonalAverage => serializer.serialize_unit_variant("ForecastingModels", 5u32, "SeasonalAverage"), - Self::ExponentialSmoothing => serializer.serialize_unit_variant("ForecastingModels", 6u32, "ExponentialSmoothing"), - Self::Arimax => serializer.serialize_unit_variant("ForecastingModels", 7u32, "Arimax"), - Self::TcnForecaster => serializer.serialize_unit_variant("ForecastingModels", 8u32, "TCNForecaster"), - Self::ElasticNet => serializer.serialize_unit_variant("ForecastingModels", 9u32, "ElasticNet"), - Self::GradientBoosting => serializer.serialize_unit_variant("ForecastingModels", 10u32, "GradientBoosting"), - Self::DecisionTree => serializer.serialize_unit_variant("ForecastingModels", 11u32, "DecisionTree"), - Self::Knn => serializer.serialize_unit_variant("ForecastingModels", 12u32, "KNN"), - Self::LassoLars => serializer.serialize_unit_variant("ForecastingModels", 13u32, "LassoLars"), - Self::Sgd => serializer.serialize_unit_variant("ForecastingModels", 14u32, "SGD"), - Self::RandomForest => serializer.serialize_unit_variant("ForecastingModels", 15u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("ForecastingModels", 16u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("ForecastingModels", 17u32, "LightGBM"), - Self::XgBoostRegressor => serializer.serialize_unit_variant("ForecastingModels", 18u32, "XGBoostRegressor"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for Forecasting task."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ForecastingPrimaryMetrics")] -pub enum ForecastingPrimaryMetrics { - SpearmanCorrelation, - NormalizedRootMeanSquaredError, - R2Score, - NormalizedMeanAbsoluteError, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ForecastingPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ForecastingPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ForecastingPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SpearmanCorrelation => serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 0u32, "SpearmanCorrelation"), - Self::NormalizedRootMeanSquaredError => { - serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 1u32, "NormalizedRootMeanSquaredError") - } - Self::R2Score => serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 2u32, "R2Score"), - Self::NormalizedMeanAbsoluteError => { - serializer.serialize_unit_variant("ForecastingPrimaryMetrics", 3u32, "NormalizedMeanAbsoluteError") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Forecasting specific parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastingSettings { - #[doc = "Country or region for holidays for forecasting tasks.\r\nThese should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'."] - #[serde(rename = "countryOrRegionForHolidays", default, skip_serializing_if = "Option::is_none")] - pub country_or_region_for_holidays: Option, - #[doc = "Number of periods between the origin time of one CV fold and the next fold. For\r\nexample, if `CVStepSize` = 3 for daily data, the origin time for each fold will be\r\nthree days apart."] - #[serde(rename = "cvStepSize", default, skip_serializing_if = "Option::is_none")] - pub cv_step_size: Option, - #[doc = "Flag for generating lags for the numeric features."] - #[serde(rename = "featureLags", default, skip_serializing_if = "Option::is_none")] - pub feature_lags: Option, - #[doc = "The feature columns that are available for training but unknown at the time of forecast/inference.\r\nIf features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in the dataset are known at inference time."] - #[serde( - rename = "featuresUnknownAtForecastTime", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub features_unknown_at_forecast_time: Vec, - #[doc = "The desired maximum forecast horizon in units of time-series frequency."] - #[serde(rename = "forecastHorizon", default, skip_serializing_if = "Option::is_none")] - pub forecast_horizon: Option, - #[doc = "When forecasting, this parameter represents the period with which the forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency by default."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub frequency: Option, - #[doc = "Forecasting seasonality."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub seasonality: Option, - #[doc = "The parameter defining how if AutoML should handle short time series."] - #[serde(rename = "shortSeriesHandlingConfig", default, skip_serializing_if = "Option::is_none")] - pub short_series_handling_config: Option, - #[doc = "Target aggregate function."] - #[serde(rename = "targetAggregateFunction", default, skip_serializing_if = "Option::is_none")] - pub target_aggregate_function: Option, - #[doc = "The number of past periods to lag from the target column."] - #[serde(rename = "targetLags", default, skip_serializing_if = "Option::is_none")] - pub target_lags: Option, - #[doc = "Forecasting target rolling window size."] - #[serde(rename = "targetRollingWindowSize", default, skip_serializing_if = "Option::is_none")] - pub target_rolling_window_size: Option, - #[doc = "The name of the time column. This parameter is required when forecasting to specify the datetime column in the input data used for building the time series and inferring its frequency."] - #[serde(rename = "timeColumnName", default, skip_serializing_if = "Option::is_none")] - pub time_column_name: Option, - #[doc = "The names of columns used to group a timeseries. It can be used to create multiple series.\r\nIf grain is not defined, the data set is assumed to be one time-series. This parameter is used with task type forecasting."] - #[serde( - rename = "timeSeriesIdColumnNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub time_series_id_column_names: Vec, - #[doc = "Configure STL Decomposition of the time-series target column."] - #[serde(rename = "useStl", default, skip_serializing_if = "Option::is_none")] - pub use_stl: Option, -} -impl ForecastingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecasting Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastingTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for forecasting task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for forecasting task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl ForecastingTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "FQDN Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FqdnOutboundRule { - #[serde(flatten)] - pub outbound_rule: OutboundRule, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, -} -impl FqdnOutboundRule { - pub fn new(outbound_rule: OutboundRule) -> Self { - Self { - outbound_rule, - destination: None, - } - } -} -#[doc = "Generation safety quality metric enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "GenerationSafetyQualityMetric")] -pub enum GenerationSafetyQualityMetric { - AcceptableGroundednessScorePerInstance, - AggregatedGroundednessPassRate, - AcceptableCoherenceScorePerInstance, - AggregatedCoherencePassRate, - AcceptableFluencyScorePerInstance, - AggregatedFluencyPassRate, - AcceptableSimilarityScorePerInstance, - AggregatedSimilarityPassRate, - AcceptableRelevanceScorePerInstance, - AggregatedRelevancePassRate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for GenerationSafetyQualityMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for GenerationSafetyQualityMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for GenerationSafetyQualityMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AcceptableGroundednessScorePerInstance => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 0u32, "AcceptableGroundednessScorePerInstance") - } - Self::AggregatedGroundednessPassRate => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 1u32, "AggregatedGroundednessPassRate") - } - Self::AcceptableCoherenceScorePerInstance => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 2u32, "AcceptableCoherenceScorePerInstance") - } - Self::AggregatedCoherencePassRate => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 3u32, "AggregatedCoherencePassRate") - } - Self::AcceptableFluencyScorePerInstance => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 4u32, "AcceptableFluencyScorePerInstance") - } - Self::AggregatedFluencyPassRate => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 5u32, "AggregatedFluencyPassRate") - } - Self::AcceptableSimilarityScorePerInstance => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 6u32, "AcceptableSimilarityScorePerInstance") - } - Self::AggregatedSimilarityPassRate => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 7u32, "AggregatedSimilarityPassRate") - } - Self::AcceptableRelevanceScorePerInstance => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 8u32, "AcceptableRelevanceScorePerInstance") - } - Self::AggregatedRelevancePassRate => { - serializer.serialize_unit_variant("GenerationSafetyQualityMetric", 9u32, "AggregatedRelevancePassRate") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Generation safety quality metric threshold definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GenerationSafetyQualityMetricThreshold { - #[doc = "Generation safety quality metric enum."] - pub metric: GenerationSafetyQualityMetric, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl GenerationSafetyQualityMetricThreshold { - pub fn new(metric: GenerationSafetyQualityMetric) -> Self { - Self { metric, threshold: None } - } -} -#[doc = "Generation safety quality monitoring signal definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GenerationSafetyQualityMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[doc = "[Required] Gets or sets the metrics to calculate and the corresponding thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[doc = "Gets or sets the target data for computing metrics."] - #[serde( - rename = "productionData", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub production_data: Vec, - #[doc = "[Required] The sample rate of the target data, should be greater than 0 and at most 1."] - #[serde(rename = "samplingRate")] - pub sampling_rate: f64, - #[doc = "Gets or sets the workspace connection ID used to connect to the content generation endpoint."] - #[serde(rename = "workspaceConnectionId", default, skip_serializing_if = "Option::is_none")] - pub workspace_connection_id: Option, -} -impl GenerationSafetyQualityMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - sampling_rate: f64, - ) -> Self { - Self { - monitoring_signal_base, - metric_thresholds, - production_data: Vec::new(), - sampling_rate, - workspace_connection_id: None, - } - } -} -#[doc = "Generation token statistics metric enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "GenerationTokenStatisticsMetric")] -pub enum GenerationTokenStatisticsMetric { - TotalTokenCount, - TotalTokenCountPerGroup, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for GenerationTokenStatisticsMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for GenerationTokenStatisticsMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for GenerationTokenStatisticsMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::TotalTokenCount => serializer.serialize_unit_variant("GenerationTokenStatisticsMetric", 0u32, "TotalTokenCount"), - Self::TotalTokenCountPerGroup => { - serializer.serialize_unit_variant("GenerationTokenStatisticsMetric", 1u32, "TotalTokenCountPerGroup") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Generation token statistics metric threshold definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GenerationTokenStatisticsMetricThreshold { - #[doc = "Generation token statistics metric enum."] - pub metric: GenerationTokenStatisticsMetric, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl GenerationTokenStatisticsMetricThreshold { - pub fn new(metric: GenerationTokenStatisticsMetric) -> Self { - Self { metric, threshold: None } - } -} -#[doc = "Generation token statistics signal definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GenerationTokenStatisticsSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[doc = "[Required] Gets or sets the metrics to calculate and the corresponding thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "productionData", default, skip_serializing_if = "Option::is_none")] - pub production_data: Option, - #[doc = "[Required] The sample rate of the target data, should be greater than 0 and at most 1."] - #[serde(rename = "samplingRate")] - pub sampling_rate: f64, -} -impl GenerationTokenStatisticsSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - sampling_rate: f64, - ) -> Self { - Self { - monitoring_signal_base, - metric_thresholds, - production_data: None, - sampling_rate, - } - } -} -#[doc = "Defines supported metric goals for hyperparameter tuning"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "Goal")] -pub enum Goal { - Minimize, - Maximize, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for Goal { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for Goal { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for Goal { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Minimize => serializer.serialize_unit_variant("Goal", 0u32, "Minimize"), - Self::Maximize => serializer.serialize_unit_variant("Goal", 1u32, "Maximize"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Defines a Sampling Algorithm that exhaustively generates every value combination in the space"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GridSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, -} -impl GridSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { sampling_algorithm } - } -} -#[doc = "A HDInsight compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdInsight { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub hd_insight_schema: HdInsightSchema, -} -impl HdInsight { - pub fn new(compute: Compute) -> Self { - Self { - compute, - hd_insight_schema: HdInsightSchema::default(), - } - } -} -#[doc = "HDInsight compute properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HdInsightProperties { - #[doc = "Port open for ssh connections on the master node of the cluster."] - #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] - pub ssh_port: Option, - #[doc = "Public IP address of the master node of the cluster."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - #[doc = "Admin credentials for virtual machine"] - #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] - pub administrator_account: Option, -} -impl HdInsightProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HdInsightSchema { - #[doc = "HDInsight compute properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl HdInsightSchema { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HdfsDatastore { - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if \"Https\" protocol is selected."] - #[serde(rename = "hdfsServerCertificate", default, skip_serializing_if = "Option::is_none")] - pub hdfs_server_certificate: Option, - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "nameNodeAddress")] - pub name_node_address: String, - #[doc = "Protocol used to communicate with the storage account (Https/Http)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, -} -impl HdfsDatastore { - pub fn new(datastore: Datastore, name_node_address: String) -> Self { - Self { - datastore, - hdfs_server_certificate: None, - name_node_address, - protocol: None, - } - } -} -#[doc = "Reference to an asset via its ARM resource ID."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "[Required] ARM resource ID of the asset."] - #[serde(rename = "assetId")] - pub asset_id: String, -} -impl IdAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase, asset_id: String) -> Self { - Self { - asset_reference_base, - asset_id, - } - } -} -#[doc = "Base definition for identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdentityConfiguration { - #[doc = "Enum to determine identity framework."] - #[serde(rename = "identityType")] - pub identity_type: IdentityConfigurationType, -} -impl IdentityConfiguration { - pub fn new(identity_type: IdentityConfigurationType) -> Self { - Self { identity_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "identityType")] -pub enum IdentityConfigurationUnion { - #[serde(rename = "AMLToken")] - AmlToken(AmlToken), - Managed(ManagedIdentity), - UserIdentity(UserIdentity), -} -#[doc = "Enum to determine identity framework."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IdentityConfigurationType")] -pub enum IdentityConfigurationType { - Managed, - #[serde(rename = "AMLToken")] - AmlToken, - UserIdentity, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for IdentityConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for IdentityConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for IdentityConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Managed => serializer.serialize_unit_variant("IdentityConfigurationType", 0u32, "Managed"), - Self::AmlToken => serializer.serialize_unit_variant("IdentityConfigurationType", 1u32, "AMLToken"), - Self::UserIdentity => serializer.serialize_unit_variant("IdentityConfigurationType", 2u32, "UserIdentity"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Identity object used for encryption."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdentityForCmk { - #[doc = "UserAssignedIdentity to be used to fetch the encryption key from keyVault"] - #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identity: Option, -} -impl IdentityForCmk { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Stops compute instance after user defined period of inactivity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdleShutdownSetting { - #[doc = "Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days."] - #[serde(rename = "idleTimeBeforeShutdown", default, skip_serializing_if = "Option::is_none")] - pub idle_time_before_shutdown: Option, -} -impl IdleShutdownSetting { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Image { - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Image reference URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reference: Option, -} -impl Image { - pub fn new() -> Self { - Self::default() - } -} -pub mod image { - use super::*; - #[doc = "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "docker")] - Docker, - #[serde(rename = "azureml")] - Azureml, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Docker => serializer.serialize_unit_variant("Type", 0u32, "docker"), - Self::Azureml => serializer.serialize_unit_variant("Type", 1u32, "azureml"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Docker - } - } -} -#[doc = "Annotation type of image data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ImageAnnotationType")] -pub enum ImageAnnotationType { - Classification, - BoundingBox, - InstanceSegmentation, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ImageAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ImageAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ImageAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("ImageAnnotationType", 0u32, "Classification"), - Self::BoundingBox => serializer.serialize_unit_variant("ImageAnnotationType", 1u32, "BoundingBox"), - Self::InstanceSegmentation => serializer.serialize_unit_variant("ImageAnnotationType", 2u32, "InstanceSegmentation"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Image Classification. Multi-class image classification is used when an image is classified with only a single label\r\nfrom a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassification { - #[serde(flatten)] - pub image_classification_base: ImageClassificationBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageClassification { - pub fn new(image_classification_base: ImageClassificationBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_classification_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassificationBase { - #[serde(flatten)] - pub image_vertical: ImageVertical, - #[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelSettings", default, skip_serializing_if = "Option::is_none")] - pub model_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, -} -impl ImageClassificationBase { - pub fn new(image_vertical: ImageVertical) -> Self { - Self { - image_vertical, - model_settings: None, - search_space: Vec::new(), - } - } -} -#[doc = "Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels\r\nfrom a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageClassificationMultilabel { - #[serde(flatten)] - pub image_classification_base: ImageClassificationBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification multilabel tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageClassificationMultilabel { - pub fn new(image_classification_base: ImageClassificationBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_classification_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level,\r\ndrawing a polygon around each object in the image."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageInstanceSegmentation { - #[serde(flatten)] - pub image_object_detection_base: ImageObjectDetectionBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for InstanceSegmentation tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageInstanceSegmentation { - pub fn new(image_object_detection_base: ImageObjectDetectionBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_object_detection_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Limit settings for the AutoML job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageLimitSettings { - #[doc = "Maximum number of concurrent AutoML iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Maximum number of AutoML iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl ImageLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Returns metadata about the operating system image for this compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageMetadata { - #[doc = "Specifies the current operating system image version this compute instance is running on."] - #[serde(rename = "currentImageVersion", default, skip_serializing_if = "Option::is_none")] - pub current_image_version: Option, - #[doc = "Specifies the latest available operating system image version."] - #[serde(rename = "latestImageVersion", default, skip_serializing_if = "Option::is_none")] - pub latest_image_version: Option, - #[doc = "Specifies whether this compute instance is running on the latest operating system image."] - #[serde(rename = "isLatestOsImageVersion", default, skip_serializing_if = "Option::is_none")] - pub is_latest_os_image_version: Option, -} -impl ImageMetadata { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettings { - #[doc = "Enable AMSGrad when optimizer is 'adam' or 'adamw'."] - #[serde(rename = "amsGradient", default, skip_serializing_if = "Option::is_none")] - pub ams_gradient: Option, - #[doc = "Settings for using Augmentations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub augmentations: Option, - #[doc = "Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta1: Option, - #[doc = "Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta2: Option, - #[doc = "Whether to use distributer training."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distributed: Option, - #[doc = "Enable early stopping logic during training."] - #[serde(rename = "earlyStopping", default, skip_serializing_if = "Option::is_none")] - pub early_stopping: Option, - #[doc = "Minimum number of epochs or validation evaluations to wait before primary metric improvement\r\nis tracked for early stopping. Must be a positive integer."] - #[serde(rename = "earlyStoppingDelay", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_delay: Option, - #[doc = "Minimum number of epochs or validation evaluations with no primary metric improvement before\r\nthe run is stopped. Must be a positive integer."] - #[serde(rename = "earlyStoppingPatience", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_patience: Option, - #[doc = "Enable normalization when exporting ONNX model."] - #[serde(rename = "enableOnnxNormalization", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_normalization: Option, - #[doc = "Frequency to evaluate validation dataset to get metric scores. Must be a positive integer."] - #[serde(rename = "evaluationFrequency", default, skip_serializing_if = "Option::is_none")] - pub evaluation_frequency: Option, - #[doc = "Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps without\r\nupdating the model weights while accumulating the gradients of those steps, and then using\r\nthe accumulated gradients to compute the weight updates. Must be a positive integer."] - #[serde(rename = "gradientAccumulationStep", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_step: Option, - #[doc = "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "layersToFreeze", default, skip_serializing_if = "Option::is_none")] - pub layers_to_freeze: Option, - #[doc = "Initial learning rate. Must be a float in the range [0, 1]."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub momentum: Option, - #[doc = "Enable nesterov when optimizer is 'sgd'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nesterov: Option, - #[doc = "Number of training epochs. Must be a positive integer."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "Number of data loader workers. Must be a non-negative integer."] - #[serde(rename = "numberOfWorkers", default, skip_serializing_if = "Option::is_none")] - pub number_of_workers: Option, - #[doc = "Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub optimizer: Option, - #[doc = "Random seed to be used when using deterministic training."] - #[serde(rename = "randomSeed", default, skip_serializing_if = "Option::is_none")] - pub random_seed: Option, - #[doc = "Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]."] - #[serde(rename = "stepLRGamma", default, skip_serializing_if = "Option::is_none")] - pub step_lr_gamma: Option, - #[doc = "Value of step size when learning rate scheduler is 'step'. Must be a positive integer."] - #[serde(rename = "stepLRStepSize", default, skip_serializing_if = "Option::is_none")] - pub step_lr_step_size: Option, - #[doc = "Training batch size. Must be a positive integer."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "Validation batch size. Must be a positive integer."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]."] - #[serde(rename = "warmupCosineLRCycles", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_cycles: Option, - #[doc = "Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer."] - #[serde(rename = "warmupCosineLRWarmupEpochs", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_warmup_epochs: Option, - #[doc = "Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl ImageModelDistributionSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettingsClassification { - #[serde(flatten)] - pub image_model_distribution_settings: ImageModelDistributionSettings, - #[doc = "Image crop size that is input to the neural network for the training dataset. Must be a positive integer."] - #[serde(rename = "trainingCropSize", default, skip_serializing_if = "Option::is_none")] - pub training_crop_size: Option, - #[doc = "Image crop size that is input to the neural network for the validation dataset. Must be a positive integer."] - #[serde(rename = "validationCropSize", default, skip_serializing_if = "Option::is_none")] - pub validation_crop_size: Option, - #[doc = "Image size to which to resize before cropping for validation dataset. Must be a positive integer."] - #[serde(rename = "validationResizeSize", default, skip_serializing_if = "Option::is_none")] - pub validation_resize_size: Option, - #[doc = "Weighted loss. The accepted values are 0 for no weighted loss.\r\n1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2."] - #[serde(rename = "weightedLoss", default, skip_serializing_if = "Option::is_none")] - pub weighted_loss: Option, -} -impl ImageModelDistributionSettingsClassification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelDistributionSettingsObjectDetection { - #[serde(flatten)] - pub image_model_distribution_settings: ImageModelDistributionSettings, - #[doc = "Maximum number of detections per image, for all classes. Must be a positive integer.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "boxDetectionsPerImage", default, skip_serializing_if = "Option::is_none")] - pub box_detections_per_image: Option, - #[doc = "During inference, only return proposals with a classification score greater than\r\nBoxScoreThreshold. Must be a float in the range[0, 1]."] - #[serde(rename = "boxScoreThreshold", default, skip_serializing_if = "Option::is_none")] - pub box_score_threshold: Option, - #[doc = "Image size for train and validation. Must be a positive integer.\r\nNote: The training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "imageSize", default, skip_serializing_if = "Option::is_none")] - pub image_size: Option, - #[doc = "Maximum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "maxSize", default, skip_serializing_if = "Option::is_none")] - pub max_size: Option, - #[doc = "Minimum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "minSize", default, skip_serializing_if = "Option::is_none")] - pub min_size: Option, - #[doc = "Model size. Must be 'small', 'medium', 'large', or 'xlarge'.\r\nNote: training run may get into CUDA OOM if the model size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "modelSize", default, skip_serializing_if = "Option::is_none")] - pub model_size: Option, - #[doc = "Enable multi-scale image by varying image size by +/- 50%.\r\nNote: training run may get into CUDA OOM if no sufficient GPU memory.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "multiScale", default, skip_serializing_if = "Option::is_none")] - pub multi_scale: Option, - #[doc = "IOU threshold used during inference in NMS post processing. Must be float in the range [0, 1]."] - #[serde(rename = "nmsIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub nms_iou_threshold: Option, - #[doc = "The grid size to use for tiling each image. Note: TileGridSize must not be\r\nNone to enable small object detection logic. A string containing two integers in mxn format.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileGridSize", default, skip_serializing_if = "Option::is_none")] - pub tile_grid_size: Option, - #[doc = "Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileOverlapRatio", default, skip_serializing_if = "Option::is_none")] - pub tile_overlap_ratio: Option, - #[doc = "The IOU threshold to use to perform NMS while merging predictions from tiles and image.\r\nUsed in validation/ inference. Must be float in the range [0, 1].\r\nNote: This settings is not supported for the 'yolov5' algorithm.\r\nNMS: Non-maximum suppression"] - #[serde(rename = "tilePredictionsNmsThreshold", default, skip_serializing_if = "Option::is_none")] - pub tile_predictions_nms_threshold: Option, - #[doc = "IOU threshold to use when computing validation metric. Must be float in the range [0, 1]."] - #[serde(rename = "validationIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub validation_iou_threshold: Option, - #[doc = "Metric computation method to use for validation metrics. Must be 'none', 'coco', 'voc', or 'coco_voc'."] - #[serde(rename = "validationMetricType", default, skip_serializing_if = "Option::is_none")] - pub validation_metric_type: Option, -} -impl ImageModelDistributionSettingsObjectDetection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettings { - #[doc = "Settings for advanced scenarios."] - #[serde(rename = "advancedSettings", default, skip_serializing_if = "Option::is_none")] - pub advanced_settings: Option, - #[doc = "Enable AMSGrad when optimizer is 'adam' or 'adamw'."] - #[serde(rename = "amsGradient", default, skip_serializing_if = "Option::is_none")] - pub ams_gradient: Option, - #[doc = "Settings for using Augmentations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub augmentations: Option, - #[doc = "Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta1: Option, - #[doc = "Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub beta2: Option, - #[doc = "Frequency to store model checkpoints. Must be a positive integer."] - #[serde(rename = "checkpointFrequency", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_frequency: Option, - #[serde(rename = "checkpointModel", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_model: Option, - #[doc = "The id of a previous run that has a pretrained checkpoint for incremental training."] - #[serde(rename = "checkpointRunId", default, skip_serializing_if = "Option::is_none")] - pub checkpoint_run_id: Option, - #[doc = "Whether to use distributed training."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distributed: Option, - #[doc = "Enable early stopping logic during training."] - #[serde(rename = "earlyStopping", default, skip_serializing_if = "Option::is_none")] - pub early_stopping: Option, - #[doc = "Minimum number of epochs or validation evaluations to wait before primary metric improvement\r\nis tracked for early stopping. Must be a positive integer."] - #[serde(rename = "earlyStoppingDelay", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_delay: Option, - #[doc = "Minimum number of epochs or validation evaluations with no primary metric improvement before\r\nthe run is stopped. Must be a positive integer."] - #[serde(rename = "earlyStoppingPatience", default, skip_serializing_if = "Option::is_none")] - pub early_stopping_patience: Option, - #[doc = "Enable normalization when exporting ONNX model."] - #[serde(rename = "enableOnnxNormalization", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_normalization: Option, - #[doc = "Frequency to evaluate validation dataset to get metric scores. Must be a positive integer."] - #[serde(rename = "evaluationFrequency", default, skip_serializing_if = "Option::is_none")] - pub evaluation_frequency: Option, - #[doc = "Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps without\r\nupdating the model weights while accumulating the gradients of those steps, and then using\r\nthe accumulated gradients to compute the weight updates. Must be a positive integer."] - #[serde(rename = "gradientAccumulationStep", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_step: Option, - #[doc = "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "layersToFreeze", default, skip_serializing_if = "Option::is_none")] - pub layers_to_freeze: Option, - #[doc = "Initial learning rate. Must be a float in the range [0, 1]."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Learning rate scheduler enum."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub momentum: Option, - #[doc = "Enable nesterov when optimizer is 'sgd'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nesterov: Option, - #[doc = "Number of training epochs. Must be a positive integer."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "Number of data loader workers. Must be a non-negative integer."] - #[serde(rename = "numberOfWorkers", default, skip_serializing_if = "Option::is_none")] - pub number_of_workers: Option, - #[doc = "Stochastic optimizer for image models."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub optimizer: Option, - #[doc = "Random seed to be used when using deterministic training."] - #[serde(rename = "randomSeed", default, skip_serializing_if = "Option::is_none")] - pub random_seed: Option, - #[doc = "Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]."] - #[serde(rename = "stepLRGamma", default, skip_serializing_if = "Option::is_none")] - pub step_lr_gamma: Option, - #[doc = "Value of step size when learning rate scheduler is 'step'. Must be a positive integer."] - #[serde(rename = "stepLRStepSize", default, skip_serializing_if = "Option::is_none")] - pub step_lr_step_size: Option, - #[doc = "Training batch size. Must be a positive integer."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "Validation batch size. Must be a positive integer."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]."] - #[serde(rename = "warmupCosineLRCycles", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_cycles: Option, - #[doc = "Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer."] - #[serde(rename = "warmupCosineLRWarmupEpochs", default, skip_serializing_if = "Option::is_none")] - pub warmup_cosine_lr_warmup_epochs: Option, - #[doc = "Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl ImageModelSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettingsClassification { - #[serde(flatten)] - pub image_model_settings: ImageModelSettings, - #[doc = "Image crop size that is input to the neural network for the training dataset. Must be a positive integer."] - #[serde(rename = "trainingCropSize", default, skip_serializing_if = "Option::is_none")] - pub training_crop_size: Option, - #[doc = "Image crop size that is input to the neural network for the validation dataset. Must be a positive integer."] - #[serde(rename = "validationCropSize", default, skip_serializing_if = "Option::is_none")] - pub validation_crop_size: Option, - #[doc = "Image size to which to resize before cropping for validation dataset. Must be a positive integer."] - #[serde(rename = "validationResizeSize", default, skip_serializing_if = "Option::is_none")] - pub validation_resize_size: Option, - #[doc = "Weighted loss. The accepted values are 0 for no weighted loss.\r\n1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2."] - #[serde(rename = "weightedLoss", default, skip_serializing_if = "Option::is_none")] - pub weighted_loss: Option, -} -impl ImageModelSettingsClassification { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImageModelSettingsObjectDetection { - #[serde(flatten)] - pub image_model_settings: ImageModelSettings, - #[doc = "Maximum number of detections per image, for all classes. Must be a positive integer.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "boxDetectionsPerImage", default, skip_serializing_if = "Option::is_none")] - pub box_detections_per_image: Option, - #[doc = "During inference, only return proposals with a classification score greater than\r\nBoxScoreThreshold. Must be a float in the range[0, 1]."] - #[serde(rename = "boxScoreThreshold", default, skip_serializing_if = "Option::is_none")] - pub box_score_threshold: Option, - #[doc = "Image size for train and validation. Must be a positive integer.\r\nNote: The training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "imageSize", default, skip_serializing_if = "Option::is_none")] - pub image_size: Option, - #[serde(rename = "logTrainingMetrics", default, skip_serializing_if = "Option::is_none")] - pub log_training_metrics: Option, - #[serde(rename = "logValidationLoss", default, skip_serializing_if = "Option::is_none")] - pub log_validation_loss: Option, - #[doc = "Maximum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "maxSize", default, skip_serializing_if = "Option::is_none")] - pub max_size: Option, - #[doc = "Minimum size of the image to be rescaled before feeding it to the backbone.\r\nMust be a positive integer. Note: training run may get into CUDA OOM if the size is too big.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "minSize", default, skip_serializing_if = "Option::is_none")] - pub min_size: Option, - #[doc = "Image model size."] - #[serde(rename = "modelSize", default, skip_serializing_if = "Option::is_none")] - pub model_size: Option, - #[doc = "Enable multi-scale image by varying image size by +/- 50%.\r\nNote: training run may get into CUDA OOM if no sufficient GPU memory.\r\nNote: This settings is only supported for the 'yolov5' algorithm."] - #[serde(rename = "multiScale", default, skip_serializing_if = "Option::is_none")] - pub multi_scale: Option, - #[doc = "IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1]."] - #[serde(rename = "nmsIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub nms_iou_threshold: Option, - #[doc = "The grid size to use for tiling each image. Note: TileGridSize must not be\r\nNone to enable small object detection logic. A string containing two integers in mxn format.\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileGridSize", default, skip_serializing_if = "Option::is_none")] - pub tile_grid_size: Option, - #[doc = "Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tileOverlapRatio", default, skip_serializing_if = "Option::is_none")] - pub tile_overlap_ratio: Option, - #[doc = "The IOU threshold to use to perform NMS while merging predictions from tiles and image.\r\nUsed in validation/ inference. Must be float in the range [0, 1].\r\nNote: This settings is not supported for the 'yolov5' algorithm."] - #[serde(rename = "tilePredictionsNmsThreshold", default, skip_serializing_if = "Option::is_none")] - pub tile_predictions_nms_threshold: Option, - #[doc = "IOU threshold to use when computing validation metric. Must be float in the range [0, 1]."] - #[serde(rename = "validationIouThreshold", default, skip_serializing_if = "Option::is_none")] - pub validation_iou_threshold: Option, - #[doc = "Metric computation method to use for validation metrics in image tasks."] - #[serde(rename = "validationMetricType", default, skip_serializing_if = "Option::is_none")] - pub validation_metric_type: Option, -} -impl ImageModelSettingsObjectDetection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Image Object Detection. Object detection is used to identify objects in an image and locate each object with a\r\nbounding box e.g. locate all dogs and cats in an image and draw a bounding box around each."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageObjectDetection { - #[serde(flatten)] - pub image_object_detection_base: ImageObjectDetectionBase, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for Image ObjectDetection task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl ImageObjectDetection { - pub fn new(image_object_detection_base: ImageObjectDetectionBase, auto_ml_vertical: AutoMlVertical) -> Self { - Self { - image_object_detection_base, - auto_ml_vertical, - primary_metric: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageObjectDetectionBase { - #[serde(flatten)] - pub image_vertical: ImageVertical, - #[doc = "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models."] - #[serde(rename = "modelSettings", default, skip_serializing_if = "Option::is_none")] - pub model_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, -} -impl ImageObjectDetectionBase { - pub fn new(image_vertical: ImageVertical) -> Self { - Self { - image_vertical, - model_settings: None, - search_space: Vec::new(), - } - } -} -#[doc = "Model sweeping and hyperparameter sweeping related settings."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl ImageSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for AutoML tasks that train image (computer vision) models -\r\nsuch as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImageVertical { - #[doc = "Limit settings for the AutoML job."] - #[serde(rename = "limitSettings")] - pub limit_settings: ImageLimitSettings, - #[doc = "Model sweeping and hyperparameter sweeping related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, - #[doc = "The fraction of training dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "validationDataSize", default, skip_serializing_if = "Option::is_none")] - pub validation_data_size: Option, -} -impl ImageVertical { - pub fn new(limit_settings: ImageLimitSettings) -> Self { - Self { - limit_settings, - sweep_settings: None, - validation_data: None, - validation_data_size: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImportDataAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[serde(rename = "dataImportDefinition")] - pub data_import_definition: DataImport, -} -impl ImportDataAction { - pub fn new(schedule_action_base: ScheduleActionBase, data_import_definition: DataImport) -> Self { - Self { - schedule_action_base, - data_import_definition, - } - } -} -#[doc = "Whether IncrementalDataRefresh is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IncrementalDataRefresh")] -pub enum IncrementalDataRefresh { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for IncrementalDataRefresh { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for IncrementalDataRefresh { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for IncrementalDataRefresh { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("IncrementalDataRefresh", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Dto object representing index column"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IndexColumn { - #[doc = "Specifies the column name"] - #[serde(rename = "columnName", default, skip_serializing_if = "Option::is_none")] - pub column_name: Option, - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option, -} -impl IndexColumn { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InferenceContainerProperties { - #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] - pub liveness_route: Option, - #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] - pub readiness_route: Option, - #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] - pub scoring_route: Option, -} -impl InferenceContainerProperties { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct InferencingServer { - #[doc = "Inferencing server type for various targets."] - #[serde(rename = "serverType")] - pub server_type: InferencingServerType, -} -impl InferencingServer { - pub fn new(server_type: InferencingServerType) -> Self { - Self { server_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "serverType")] -pub enum InferencingServerUnion { - #[serde(rename = "AzureMLBatch")] - AzureMlBatch(AzureMlBatchInferencingServer), - #[serde(rename = "AzureMLOnline")] - AzureMlOnline(AzureMlOnlineInferencingServer), - Custom(CustomInferencingServer), - Triton(TritonInferencingServer), -} -#[doc = "Inferencing server type for various targets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InferencingServerType")] -pub enum InferencingServerType { - #[serde(rename = "AzureMLOnline")] - AzureMlOnline, - #[serde(rename = "AzureMLBatch")] - AzureMlBatch, - Triton, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InferencingServerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InferencingServerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InferencingServerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureMlOnline => serializer.serialize_unit_variant("InferencingServerType", 0u32, "AzureMLOnline"), - Self::AzureMlBatch => serializer.serialize_unit_variant("InferencingServerType", 1u32, "AzureMLBatch"), - Self::Triton => serializer.serialize_unit_variant("InferencingServerType", 2u32, "Triton"), - Self::Custom => serializer.serialize_unit_variant("InferencingServerType", 3u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the input data delivery mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InputDeliveryMode")] -pub enum InputDeliveryMode { - ReadOnlyMount, - ReadWriteMount, - Download, - Direct, - EvalMount, - EvalDownload, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadOnlyMount => serializer.serialize_unit_variant("InputDeliveryMode", 0u32, "ReadOnlyMount"), - Self::ReadWriteMount => serializer.serialize_unit_variant("InputDeliveryMode", 1u32, "ReadWriteMount"), - Self::Download => serializer.serialize_unit_variant("InputDeliveryMode", 2u32, "Download"), - Self::Direct => serializer.serialize_unit_variant("InputDeliveryMode", 3u32, "Direct"), - Self::EvalMount => serializer.serialize_unit_variant("InputDeliveryMode", 4u32, "EvalMount"), - Self::EvalDownload => serializer.serialize_unit_variant("InputDeliveryMode", 5u32, "EvalDownload"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Input path type for package inputs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InputPathType")] -pub enum InputPathType { - Url, - PathId, - PathVersion, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InputPathType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InputPathType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InputPathType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Url => serializer.serialize_unit_variant("InputPathType", 0u32, "Url"), - Self::PathId => serializer.serialize_unit_variant("InputPathType", 1u32, "PathId"), - Self::PathVersion => serializer.serialize_unit_variant("InputPathType", 2u32, "PathVersion"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Resource requests/limits for this instance type"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InstanceResourceSchema {} -impl InstanceResourceSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Primary metrics for InstanceSegmentation tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "InstanceSegmentationPrimaryMetrics")] -pub enum InstanceSegmentationPrimaryMetrics { - MeanAveragePrecision, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for InstanceSegmentationPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for InstanceSegmentationPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for InstanceSegmentationPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAveragePrecision => { - serializer.serialize_unit_variant("InstanceSegmentationPrimaryMetrics", 0u32, "MeanAveragePrecision") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Instance type schema."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct InstanceTypeSchema { - #[doc = "Node Selector"] - #[serde(rename = "nodeSelector", default, skip_serializing_if = "Option::is_none")] - pub node_selector: Option, - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl InstanceTypeSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod instance_type_schema { - use super::*; - #[doc = "Resource requests/limits for this instance type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Resources { - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requests: Option, - #[doc = "Resource requests/limits for this instance type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, - } - impl Resources { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Intellectual Property details for a resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IntellectualProperty { - #[doc = "Protection level associated with the Intellectual Property."] - #[serde(rename = "protectionLevel", default, skip_serializing_if = "Option::is_none")] - pub protection_level: Option, - #[doc = "[Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name."] - pub publisher: String, -} -impl IntellectualProperty { - pub fn new(publisher: String) -> Self { - Self { - protection_level: None, - publisher, - } - } -} -#[doc = "Isolation mode for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "IsolationMode")] -pub enum IsolationMode { - Disabled, - AllowInternetOutbound, - AllowOnlyApprovedOutbound, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for IsolationMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for IsolationMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for IsolationMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("IsolationMode", 0u32, "Disabled"), - Self::AllowInternetOutbound => serializer.serialize_unit_variant("IsolationMode", 1u32, "AllowInternetOutbound"), - Self::AllowOnlyApprovedOutbound => serializer.serialize_unit_variant("IsolationMode", 2u32, "AllowOnlyApprovedOutbound"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition for a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobBase { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "ARM resource ID of the component resource."] - #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] - pub component_id: Option, - #[doc = "ARM resource ID of the compute resource."] - #[serde(rename = "computeId", default, skip_serializing_if = "Option::is_none")] - pub compute_id: Option, - #[doc = "Display name of job."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The name of the experiment the job belongs to. If not set, the job is placed in the \"Default\" experiment."] - #[serde(rename = "experimentName", default, skip_serializing_if = "Option::is_none")] - pub experiment_name: Option, - #[doc = "Base definition for identity configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Is the asset archived?"] - #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")] - pub is_archived: Option, - #[doc = "Enum to determine the type of job."] - #[serde(rename = "jobType")] - pub job_type: JobType, - #[doc = "Configuration for notification."] - #[serde(rename = "notificationSetting", default, skip_serializing_if = "Option::is_none")] - pub notification_setting: Option, - #[doc = "Configuration for secrets to be made available during runtime."] - #[serde(rename = "secretsConfiguration", default, skip_serializing_if = "Option::is_none")] - pub secrets_configuration: Option, - #[doc = "List of JobEndpoints.\r\nFor local jobs, a job endpoint will have an endpoint value of FileStreamObject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub services: Option, - #[doc = "The status of a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl JobBase { - pub fn new(job_type: JobType) -> Self { - Self { - resource_base: ResourceBase::default(), - component_id: None, - compute_id: None, - display_name: None, - experiment_name: None, - identity: None, - is_archived: None, - job_type, - notification_setting: None, - secrets_configuration: None, - services: None, - status: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobType")] -pub enum JobBaseUnion { - #[serde(rename = "AutoML")] - AutoMl(AutoMlJob), - Command(CommandJob), - Labeling(LabelingJob), - Pipeline(PipelineJob), - Spark(SparkJob), - Sweep(SweepJob), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobBaseResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Base definition for a job."] - pub properties: JobBaseUnion, -} -impl JobBaseResource { - pub fn new(properties: JobBaseUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of JobBase entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobBaseResourceArmPaginatedResult { - #[doc = "The link to the next page of JobBase objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type JobBase."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for JobBaseResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl JobBaseResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Command job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobInput { - #[doc = "Description for the input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Enum to determine the Job Input Type."] - #[serde(rename = "jobInputType")] - pub job_input_type: JobInputType, -} -impl JobInput { - pub fn new(job_input_type: JobInputType) -> Self { - Self { - description: None, - job_input_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobInputType")] -pub enum JobInputUnion { - #[serde(rename = "custom_model")] - CustomModel(CustomModelJobInput), - #[serde(rename = "literal")] - Literal(LiteralJobInput), - #[serde(rename = "mlflow_model")] - MlflowModel(MlFlowModelJobInput), - #[serde(rename = "mltable")] - Mltable(MlTableJobInput), - #[serde(rename = "triton_model")] - TritonModel(TritonModelJobInput), - #[serde(rename = "uri_file")] - UriFile(UriFileJobInput), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderJobInput), -} -#[doc = "Enum to determine the Job Input Type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobInputType")] -pub enum JobInputType { - #[serde(rename = "literal")] - Literal, - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(rename = "custom_model")] - CustomModel, - #[serde(rename = "mlflow_model")] - MlflowModel, - #[serde(rename = "triton_model")] - TritonModel, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobInputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobInputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobInputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Literal => serializer.serialize_unit_variant("JobInputType", 0u32, "literal"), - Self::UriFile => serializer.serialize_unit_variant("JobInputType", 1u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("JobInputType", 2u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("JobInputType", 3u32, "mltable"), - Self::CustomModel => serializer.serialize_unit_variant("JobInputType", 4u32, "custom_model"), - Self::MlflowModel => serializer.serialize_unit_variant("JobInputType", 5u32, "mlflow_model"), - Self::TritonModel => serializer.serialize_unit_variant("JobInputType", 6u32, "triton_model"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobLimits { - #[serde(rename = "jobLimitsType")] - pub job_limits_type: JobLimitsType, - #[doc = "The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl JobLimits { - pub fn new(job_limits_type: JobLimitsType) -> Self { - Self { - job_limits_type, - timeout: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobLimitsType")] -pub enum JobLimitsUnion { - Command(CommandJobLimits), - Sweep(SweepJobLimits), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobLimitsType")] -pub enum JobLimitsType { - Command, - Sweep, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobLimitsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobLimitsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobLimitsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Command => serializer.serialize_unit_variant("JobLimitsType", 0u32, "Command"), - Self::Sweep => serializer.serialize_unit_variant("JobLimitsType", 1u32, "Sweep"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Job output definition container information on where to find job output/logs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobOutput { - #[doc = "Description for the output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Enum to determine the Job Output Type."] - #[serde(rename = "jobOutputType")] - pub job_output_type: JobOutputType, -} -impl JobOutput { - pub fn new(job_output_type: JobOutputType) -> Self { - Self { - description: None, - job_output_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "jobOutputType")] -pub enum JobOutputUnion { - #[serde(rename = "custom_model")] - CustomModel(CustomModelJobOutput), - #[serde(rename = "mlflow_model")] - MlflowModel(MlFlowModelJobOutput), - #[serde(rename = "mltable")] - Mltable(MlTableJobOutput), - #[serde(rename = "triton_model")] - TritonModel(TritonModelJobOutput), - #[serde(rename = "uri_file")] - UriFile(UriFileJobOutput), - #[serde(rename = "uri_folder")] - UriFolder(UriFolderJobOutput), -} -#[doc = "Enum to determine the Job Output Type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobOutputType")] -pub enum JobOutputType { - #[serde(rename = "uri_file")] - UriFile, - #[serde(rename = "uri_folder")] - UriFolder, - #[serde(rename = "mltable")] - Mltable, - #[serde(rename = "custom_model")] - CustomModel, - #[serde(rename = "mlflow_model")] - MlflowModel, - #[serde(rename = "triton_model")] - TritonModel, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobOutputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobOutputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobOutputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("JobOutputType", 0u32, "uri_file"), - Self::UriFolder => serializer.serialize_unit_variant("JobOutputType", 1u32, "uri_folder"), - Self::Mltable => serializer.serialize_unit_variant("JobOutputType", 2u32, "mltable"), - Self::CustomModel => serializer.serialize_unit_variant("JobOutputType", 3u32, "custom_model"), - Self::MlflowModel => serializer.serialize_unit_variant("JobOutputType", 4u32, "mlflow_model"), - Self::TritonModel => serializer.serialize_unit_variant("JobOutputType", 5u32, "triton_model"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the job provisioning state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobProvisioningState")] -pub enum JobProvisioningState { - Succeeded, - Failed, - Canceled, - InProgress, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("JobProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("JobProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobProvisioningState", 2u32, "Canceled"), - Self::InProgress => serializer.serialize_unit_variant("JobProvisioningState", 3u32, "InProgress"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobResourceConfiguration { - #[serde(flatten)] - pub resource_configuration: ResourceConfiguration, - #[doc = "Extra arguments to pass to the Docker run command. This would override any parameters that have already been set by the system, or in this section. This parameter is only supported for Azure ML compute types."] - #[serde(rename = "dockerArgs", default, skip_serializing_if = "Option::is_none")] - pub docker_args: Option, - #[doc = "Size of the docker container's shared memory block. This should be in the format of (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes)."] - #[serde(rename = "shmSize", default, skip_serializing_if = "Option::is_none")] - pub shm_size: Option, -} -impl JobResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct JobScheduleAction { - #[serde(flatten)] - pub schedule_action_base: ScheduleActionBase, - #[doc = "Base definition for a job."] - #[serde(rename = "jobDefinition")] - pub job_definition: JobBaseUnion, -} -impl JobScheduleAction { - pub fn new(schedule_action_base: ScheduleActionBase, job_definition: JobBaseUnion) -> Self { - Self { - schedule_action_base, - job_definition, - } - } -} -#[doc = "Job endpoint definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct JobService { - #[doc = "Url for endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "Any error in the service."] - #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[doc = "Endpoint type."] - #[serde(rename = "jobServiceType", default, skip_serializing_if = "Option::is_none")] - pub job_service_type: Option, - #[doc = "Abstract Nodes definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nodes: Option, - #[doc = "Port for endpoint set by user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "Additional properties to set on the endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Status of endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl JobService { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The status of a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobStatus")] -pub enum JobStatus { - NotStarted, - Starting, - Provisioning, - Preparing, - Queued, - Running, - Finalizing, - CancelRequested, - Completed, - Failed, - Canceled, - NotResponding, - Paused, - Unknown, - Scheduled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotStarted => serializer.serialize_unit_variant("JobStatus", 0u32, "NotStarted"), - Self::Starting => serializer.serialize_unit_variant("JobStatus", 1u32, "Starting"), - Self::Provisioning => serializer.serialize_unit_variant("JobStatus", 2u32, "Provisioning"), - Self::Preparing => serializer.serialize_unit_variant("JobStatus", 3u32, "Preparing"), - Self::Queued => serializer.serialize_unit_variant("JobStatus", 4u32, "Queued"), - Self::Running => serializer.serialize_unit_variant("JobStatus", 5u32, "Running"), - Self::Finalizing => serializer.serialize_unit_variant("JobStatus", 6u32, "Finalizing"), - Self::CancelRequested => serializer.serialize_unit_variant("JobStatus", 7u32, "CancelRequested"), - Self::Completed => serializer.serialize_unit_variant("JobStatus", 8u32, "Completed"), - Self::Failed => serializer.serialize_unit_variant("JobStatus", 9u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("JobStatus", 10u32, "Canceled"), - Self::NotResponding => serializer.serialize_unit_variant("JobStatus", 11u32, "NotResponding"), - Self::Paused => serializer.serialize_unit_variant("JobStatus", 12u32, "Paused"), - Self::Unknown => serializer.serialize_unit_variant("JobStatus", 13u32, "Unknown"), - Self::Scheduled => serializer.serialize_unit_variant("JobStatus", 14u32, "Scheduled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the job tier."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobTier")] -pub enum JobTier { - Null, - Spot, - Basic, - Standard, - Premium, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobTier { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobTier { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobTier { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Null => serializer.serialize_unit_variant("JobTier", 0u32, "Null"), - Self::Spot => serializer.serialize_unit_variant("JobTier", 1u32, "Spot"), - Self::Basic => serializer.serialize_unit_variant("JobTier", 2u32, "Basic"), - Self::Standard => serializer.serialize_unit_variant("JobTier", 3u32, "Standard"), - Self::Premium => serializer.serialize_unit_variant("JobTier", 4u32, "Premium"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the type of job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "JobType")] -pub enum JobType { - #[serde(rename = "AutoML")] - AutoMl, - Command, - Labeling, - Sweep, - Pipeline, - Spark, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for JobType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for JobType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for JobType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AutoMl => serializer.serialize_unit_variant("JobType", 0u32, "AutoML"), - Self::Command => serializer.serialize_unit_variant("JobType", 1u32, "Command"), - Self::Labeling => serializer.serialize_unit_variant("JobType", 2u32, "Labeling"), - Self::Sweep => serializer.serialize_unit_variant("JobType", 3u32, "Sweep"), - Self::Pipeline => serializer.serialize_unit_variant("JobType", 4u32, "Pipeline"), - Self::Spark => serializer.serialize_unit_variant("JobType", 5u32, "Spark"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosCredentials { - #[doc = "[Required] IP Address or DNS HostName."] - #[serde(rename = "kerberosKdcAddress")] - pub kerberos_kdc_address: String, - #[doc = "[Required] Kerberos Username"] - #[serde(rename = "kerberosPrincipal")] - pub kerberos_principal: String, - #[doc = "[Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service."] - #[serde(rename = "kerberosRealm")] - pub kerberos_realm: String, -} -impl KerberosCredentials { - pub fn new(kerberos_kdc_address: String, kerberos_principal: String, kerberos_realm: String) -> Self { - Self { - kerberos_kdc_address, - kerberos_principal, - kerberos_realm, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosKeytabSecrets, -} -impl KerberosKeytabCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosKeytabSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosKeytabSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos keytab secret."] - #[serde(rename = "kerberosKeytab", default, skip_serializing_if = "Option::is_none")] - pub kerberos_keytab: Option, -} -impl KerberosKeytabSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_keytab: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordCredentials { - #[serde(flatten)] - pub kerberos_credentials: KerberosCredentials, - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - pub secrets: KerberosPasswordSecrets, -} -impl KerberosPasswordCredentials { - pub fn new( - kerberos_credentials: KerberosCredentials, - datastore_credentials: DatastoreCredentials, - secrets: KerberosPasswordSecrets, - ) -> Self { - Self { - kerberos_credentials, - datastore_credentials, - secrets, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosPasswordSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Kerberos password secret."] - #[serde(rename = "kerberosPassword", default, skip_serializing_if = "Option::is_none")] - pub kerberos_password: Option, -} -impl KerberosPasswordSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - kerberos_password: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "KeyType")] -pub enum KeyType { - Primary, - Secondary, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for KeyType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for KeyType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for KeyType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Primary => serializer.serialize_unit_variant("KeyType", 0u32, "Primary"), - Self::Secondary => serializer.serialize_unit_variant("KeyType", 1u32, "Secondary"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Customer Key vault properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KeyVaultProperties { - #[doc = "Currently, we support only SystemAssigned MSI.\r\nWe need this when we support UserAssignedIdentities"] - #[serde(rename = "identityClientId", default, skip_serializing_if = "Option::is_none")] - pub identity_client_id: Option, - #[doc = "KeyVault key identifier to encrypt the data"] - #[serde(rename = "keyIdentifier")] - pub key_identifier: String, - #[doc = "KeyVault Arm Id that contains the data encryption key"] - #[serde(rename = "keyVaultArmId")] - pub key_vault_arm_id: String, -} -impl KeyVaultProperties { - pub fn new(key_identifier: String, key_vault_arm_id: String) -> Self { - Self { - identity_client_id: None, - key_identifier, - key_vault_arm_id, - } - } -} -#[doc = "A Machine Learning compute based on Kubernetes Compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Kubernetes { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub kubernetes_schema: KubernetesSchema, -} -impl Kubernetes { - pub fn new(compute: Compute) -> Self { - Self { - compute, - kubernetes_schema: KubernetesSchema::default(), - } - } -} -#[doc = "Properties specific to a KubernetesOnlineDeployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KubernetesOnlineDeployment { - #[serde(flatten)] - pub online_deployment: OnlineDeployment, - #[doc = "Resource requirements for each container instance within an online deployment."] - #[serde(rename = "containerResourceRequirements", default, skip_serializing_if = "Option::is_none")] - pub container_resource_requirements: Option, -} -impl KubernetesOnlineDeployment { - pub fn new(online_deployment: OnlineDeployment) -> Self { - Self { - online_deployment, - container_resource_requirements: None, - } - } -} -#[doc = "Kubernetes properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KubernetesProperties { - #[doc = "Relay connection string."] - #[serde(rename = "relayConnectionString", default, skip_serializing_if = "Option::is_none")] - pub relay_connection_string: Option, - #[doc = "ServiceBus connection string."] - #[serde(rename = "serviceBusConnectionString", default, skip_serializing_if = "Option::is_none")] - pub service_bus_connection_string: Option, - #[doc = "Extension principal-id."] - #[serde(rename = "extensionPrincipalId", default, skip_serializing_if = "Option::is_none")] - pub extension_principal_id: Option, - #[doc = "Extension instance release train."] - #[serde(rename = "extensionInstanceReleaseTrain", default, skip_serializing_if = "Option::is_none")] - pub extension_instance_release_train: Option, - #[doc = "VC name."] - #[serde(rename = "vcName", default, skip_serializing_if = "Option::is_none")] - pub vc_name: Option, - #[doc = "Compute namespace"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, - #[doc = "Default instance type"] - #[serde(rename = "defaultInstanceType", default, skip_serializing_if = "Option::is_none")] - pub default_instance_type: Option, - #[doc = "Instance Type Schema"] - #[serde(rename = "instanceTypes", default, skip_serializing_if = "Option::is_none")] - pub instance_types: Option, -} -impl KubernetesProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Kubernetes Compute Schema"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KubernetesSchema { - #[doc = "Kubernetes properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl KubernetesSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label category definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelCategory { - #[doc = "Dictionary of label classes in this category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub classes: Option, - #[doc = "Display name of the label category."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Whether multiSelect is enabled"] - #[serde(rename = "multiSelect", default, skip_serializing_if = "Option::is_none")] - pub multi_select: Option, -} -impl LabelCategory { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Label class definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelClass { - #[doc = "Display name of the label class."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Dictionary of subclasses of the label class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subclasses: Option, -} -impl LabelClass { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling data configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingDataConfiguration { - #[doc = "Resource Id of the data asset to perform labeling."] - #[serde(rename = "dataId", default, skip_serializing_if = "Option::is_none")] - pub data_id: Option, - #[doc = "Whether IncrementalDataRefresh is enabled"] - #[serde(rename = "incrementalDataRefresh", default, skip_serializing_if = "Option::is_none")] - pub incremental_data_refresh: Option, -} -impl LabelingDataConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Labeling job definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Created time of the job in UTC timezone."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[doc = "Labeling data configuration definition"] - #[serde(rename = "dataConfiguration", default, skip_serializing_if = "Option::is_none")] - pub data_configuration: Option, - #[doc = "Instructions for labeling job"] - #[serde(rename = "jobInstructions", default, skip_serializing_if = "Option::is_none")] - pub job_instructions: Option, - #[doc = "Label categories of the job."] - #[serde(rename = "labelCategories", default, skip_serializing_if = "Option::is_none")] - pub label_categories: Option, - #[doc = "Properties of a labeling job"] - #[serde(rename = "labelingJobMediaProperties", default, skip_serializing_if = "Option::is_none")] - pub labeling_job_media_properties: Option, - #[doc = "Labeling MLAssist configuration definition"] - #[serde(rename = "mlAssistConfiguration", default, skip_serializing_if = "Option::is_none")] - pub ml_assist_configuration: Option, - #[doc = "Progress metrics definition"] - #[serde(rename = "progressMetrics", default, skip_serializing_if = "Option::is_none")] - pub progress_metrics: Option, - #[doc = "Internal id of the job(Previously called project)."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option, - #[doc = "Enum to determine the job provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Status messages of the job."] - #[serde( - rename = "statusMessages", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub status_messages: Vec, -} -impl LabelingJob { - pub fn new(job_base: JobBase) -> Self { - Self { - job_base, - created_date_time: None, - data_configuration: None, - job_instructions: None, - label_categories: None, - labeling_job_media_properties: None, - ml_assist_configuration: None, - progress_metrics: None, - project_id: None, - provisioning_state: None, - status_messages: Vec::new(), - } - } -} -#[doc = "Properties of a labeling job for image data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobImageProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of image data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobImageProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[doc = "Instructions for labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobInstructions { - #[doc = "The link to a page with detailed labeling instructions for labelers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, -} -impl LabelingJobInstructions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobMediaProperties { - #[doc = "Media type of data asset."] - #[serde(rename = "mediaType")] - pub media_type: MediaType, -} -impl LabelingJobMediaProperties { - pub fn new(media_type: MediaType) -> Self { - Self { media_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mediaType")] -pub enum LabelingJobMediaPropertiesUnion { - Image(LabelingJobImageProperties), - Text(LabelingJobTextProperties), -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Labeling job definition"] - pub properties: LabelingJob, -} -impl LabelingJobResource { - pub fn new(properties: LabelingJob) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of LabelingJob entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LabelingJobResourceArmPaginatedResult { - #[doc = "The link to the next page of LabelingJob objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type LabelingJob."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for LabelingJobResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl LabelingJobResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a labeling job for text data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelingJobTextProperties { - #[serde(flatten)] - pub labeling_job_media_properties: LabelingJobMediaProperties, - #[doc = "Annotation type of text data."] - #[serde(rename = "annotationType", default, skip_serializing_if = "Option::is_none")] - pub annotation_type: Option, -} -impl LabelingJobTextProperties { - pub fn new(labeling_job_media_properties: LabelingJobMediaProperties) -> Self { - Self { - labeling_job_media_properties, - annotation_type: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LakeHouseArtifact { - #[serde(flatten)] - pub one_lake_artifact: OneLakeArtifact, -} -impl LakeHouseArtifact { - pub fn new(one_lake_artifact: OneLakeArtifact) -> Self { - Self { one_lake_artifact } - } -} -#[doc = "Learning rate scheduler enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LearningRateScheduler")] -pub enum LearningRateScheduler { - None, - WarmupCosine, - Step, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("LearningRateScheduler", 0u32, "None"), - Self::WarmupCosine => serializer.serialize_unit_variant("LearningRateScheduler", 1u32, "WarmupCosine"), - Self::Step => serializer.serialize_unit_variant("LearningRateScheduler", 2u32, "Step"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The List Aml user feature operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListAmlUserFeatureResult { - #[doc = "The list of AML user facing features."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListAmlUserFeatureResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListAmlUserFeatureResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListNotebookKeysResult { - #[doc = "The primary access key of the Notebook"] - #[serde(rename = "primaryAccessKey", default, skip_serializing_if = "Option::is_none")] - pub primary_access_key: Option, - #[doc = "The secondary access key of the Notebook"] - #[serde(rename = "secondaryAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secondary_access_key: Option, -} -impl ListNotebookKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListStorageAccountKeysResult { - #[doc = "The access key of the storage"] - #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] - pub user_storage_key: Option, -} -impl ListStorageAccountKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List Usages operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListUsagesResult { - #[doc = "The list of AML resource usages."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListUsagesResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListUsagesResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ListViewType")] -pub enum ListViewType { - ActiveOnly, - ArchivedOnly, - All, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ListViewType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ListViewType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ListViewType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ActiveOnly => serializer.serialize_unit_variant("ListViewType", 0u32, "ActiveOnly"), - Self::ArchivedOnly => serializer.serialize_unit_variant("ListViewType", 1u32, "ArchivedOnly"), - Self::All => serializer.serialize_unit_variant("ListViewType", 2u32, "All"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListWorkspaceKeysResult { - #[doc = "The access key of the workspace app insights"] - #[serde(rename = "appInsightsInstrumentationKey", default, skip_serializing_if = "Option::is_none")] - pub app_insights_instrumentation_key: Option, - #[serde(rename = "containerRegistryCredentials", default, skip_serializing_if = "Option::is_none")] - pub container_registry_credentials: Option, - #[serde(rename = "notebookAccessKeys", default, skip_serializing_if = "Option::is_none")] - pub notebook_access_keys: Option, - #[doc = "The arm Id key of the workspace storage"] - #[serde(rename = "userStorageArmId", default, skip_serializing_if = "Option::is_none")] - pub user_storage_arm_id: Option, - #[doc = "The access key of the workspace storage"] - #[serde(rename = "userStorageKey", default, skip_serializing_if = "Option::is_none")] - pub user_storage_key: Option, -} -impl ListWorkspaceKeysResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List WorkspaceQuotasByVMFamily operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ListWorkspaceQuotas { - #[doc = "The list of Workspace Quotas by VM Family"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ListWorkspaceQuotas { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ListWorkspaceQuotas { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Literal input type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct LiteralJobInput { - #[serde(flatten)] - pub job_input: JobInput, - #[doc = "[Required] Literal value for the input."] - pub value: String, -} -impl LiteralJobInput { - pub fn new(job_input: JobInput, value: String) -> Self { - Self { job_input, value } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LogTrainingMetrics")] -pub enum LogTrainingMetrics { - Enable, - Disable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LogTrainingMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LogTrainingMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LogTrainingMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enable => serializer.serialize_unit_variant("LogTrainingMetrics", 0u32, "Enable"), - Self::Disable => serializer.serialize_unit_variant("LogTrainingMetrics", 1u32, "Disable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LogValidationLoss")] -pub enum LogValidationLoss { - Enable, - Disable, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LogValidationLoss { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LogValidationLoss { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LogValidationLoss { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enable => serializer.serialize_unit_variant("LogValidationLoss", 0u32, "Enable"), - Self::Disable => serializer.serialize_unit_variant("LogValidationLoss", 1u32, "Disable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum for setting log verbosity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "LogVerbosity")] -pub enum LogVerbosity { - NotSet, - Debug, - Info, - Warning, - Error, - Critical, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for LogVerbosity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for LogVerbosity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for LogVerbosity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotSet => serializer.serialize_unit_variant("LogVerbosity", 0u32, "NotSet"), - Self::Debug => serializer.serialize_unit_variant("LogVerbosity", 1u32, "Debug"), - Self::Info => serializer.serialize_unit_variant("LogVerbosity", 2u32, "Info"), - Self::Warning => serializer.serialize_unit_variant("LogVerbosity", 3u32, "Warning"), - Self::Error => serializer.serialize_unit_variant("LogVerbosity", 4u32, "Error"), - Self::Critical => serializer.serialize_unit_variant("LogVerbosity", 5u32, "Critical"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Labeling MLAssist configuration definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfiguration { - #[serde(rename = "mlAssist")] - pub ml_assist: MlAssistConfigurationType, -} -impl MlAssistConfiguration { - pub fn new(ml_assist: MlAssistConfigurationType) -> Self { - Self { ml_assist } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mlAssist")] -pub enum MlAssistConfigurationUnion { - Disabled(MlAssistConfigurationDisabled), - Enabled(MlAssistConfigurationEnabled), -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is disabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationDisabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, -} -impl MlAssistConfigurationDisabled { - pub fn new(ml_assist_configuration: MlAssistConfiguration) -> Self { - Self { ml_assist_configuration } - } -} -#[doc = "Labeling MLAssist configuration definition when MLAssist is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlAssistConfigurationEnabled { - #[serde(flatten)] - pub ml_assist_configuration: MlAssistConfiguration, - #[doc = "[Required] AML compute binding used in inferencing."] - #[serde(rename = "inferencingComputeBinding")] - pub inferencing_compute_binding: String, - #[doc = "[Required] AML compute binding used in training."] - #[serde(rename = "trainingComputeBinding")] - pub training_compute_binding: String, -} -impl MlAssistConfigurationEnabled { - pub fn new( - ml_assist_configuration: MlAssistConfiguration, - inferencing_compute_binding: String, - training_compute_binding: String, - ) -> Self { - Self { - ml_assist_configuration, - inferencing_compute_binding, - training_compute_binding, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlAssistConfigurationType")] -pub enum MlAssistConfigurationType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlAssistConfigurationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlAssistConfigurationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlAssistConfigurationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlAssistConfigurationType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine the state of mlflow autologger."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MlFlowAutologgerState")] -pub enum MlFlowAutologgerState { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MlFlowAutologgerState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MlFlowAutologgerState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MlFlowAutologgerState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MlFlowAutologgerState", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlFlowModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl MlFlowModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlFlowModelJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl MlFlowModelJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "MLTable data definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableData { - #[serde(flatten)] - pub data_version_base: DataVersionBase, - #[doc = "Uris referenced in the MLTable definition (required for lineage)"] - #[serde( - rename = "referencedUris", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub referenced_uris: Vec, -} -impl MlTableData { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { - data_version_base, - referenced_uris: Vec::new(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl MlTableJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MlTableJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl MlTableJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "Managed compute identity definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedComputeIdentity { - #[serde(flatten)] - pub monitor_compute_identity_base: MonitorComputeIdentityBase, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, -} -impl ManagedComputeIdentity { - pub fn new(monitor_compute_identity_base: MonitorComputeIdentityBase) -> Self { - Self { - monitor_compute_identity_base, - identity: None, - } - } -} -#[doc = "Managed identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedIdentity { - #[serde(flatten)] - pub identity_configuration: IdentityConfiguration, - #[doc = "Specifies a user-assigned identity by client ID. For system-assigned, do not set this field."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[doc = "Specifies a user-assigned identity by object ID. For system-assigned, do not set this field."] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option, - #[doc = "Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not set this field."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl ManagedIdentity { - pub fn new(identity_configuration: IdentityConfiguration) -> Self { - Self { - identity_configuration, - client_id: None, - object_id: None, - resource_id: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedIdentityAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ManagedIdentityAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Managed Network Provisioning options for managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedNetworkProvisionOptions { - #[serde(rename = "includeSpark", default, skip_serializing_if = "Option::is_none")] - pub include_spark: Option, -} -impl ManagedNetworkProvisionOptions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Status of the Provisioning for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedNetworkProvisionStatus { - #[serde(rename = "sparkReady", default, skip_serializing_if = "Option::is_none")] - pub spark_ready: Option, - #[doc = "Status for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl ManagedNetworkProvisionStatus { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Managed Network settings for a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedNetworkSettings { - #[doc = "Isolation mode for the managed network of a machine learning workspace."] - #[serde(rename = "isolationMode", default, skip_serializing_if = "Option::is_none")] - pub isolation_mode: Option, - #[serde(rename = "networkId", default, skip_serializing_if = "Option::is_none")] - pub network_id: Option, - #[serde(rename = "outboundRules", default, skip_serializing_if = "Option::is_none")] - pub outbound_rules: Option, - #[doc = "Status of the Provisioning for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl ManagedNetworkSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Status for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ManagedNetworkStatus")] -pub enum ManagedNetworkStatus { - Inactive, - Active, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ManagedNetworkStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ManagedNetworkStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ManagedNetworkStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Inactive => serializer.serialize_unit_variant("ManagedNetworkStatus", 0u32, "Inactive"), - Self::Active => serializer.serialize_unit_variant("ManagedNetworkStatus", 1u32, "Active"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Properties specific to a ManagedOnlineDeployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedOnlineDeployment { - #[serde(flatten)] - pub online_deployment: OnlineDeployment, -} -impl ManagedOnlineDeployment { - pub fn new(online_deployment: OnlineDeployment) -> Self { - Self { online_deployment } - } -} -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ManagedServiceIdentity { - #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] - #[serde(rename = "type")] - pub type_: ManagedServiceIdentityType, - #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] - #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identities: Option, -} -impl ManagedServiceIdentity { - pub fn new(type_: ManagedServiceIdentityType) -> Self { - Self { - principal_id: None, - tenant_id: None, - type_, - user_assigned_identities: None, - } - } -} -#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ManagedServiceIdentityType")] -pub enum ManagedServiceIdentityType { - None, - SystemAssigned, - UserAssigned, - #[serde(rename = "SystemAssigned,UserAssigned")] - SystemAssignedUserAssigned, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ManagedServiceIdentityType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ManagedServiceIdentityType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ManagedServiceIdentityType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), - Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), - Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), - Self::SystemAssignedUserAssigned => { - serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned,UserAssigned") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Dto object representing compute resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MaterializationComputeResource { - #[doc = "Specifies the instance type"] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, -} -impl MaterializationComputeResource { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MaterializationSettings { - #[doc = "Configuration for notification."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub notification: Option, - #[doc = "Dto object representing compute resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, - #[doc = "Specifies the spark compute settings"] - #[serde(rename = "sparkConfiguration", default, skip_serializing_if = "Option::is_none")] - pub spark_configuration: Option, - #[serde(rename = "storeType", default, skip_serializing_if = "Option::is_none")] - pub store_type: Option, -} -impl MaterializationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MaterializationStoreType")] -pub enum MaterializationStoreType { - None, - Online, - Offline, - OnlineAndOffline, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MaterializationStoreType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MaterializationStoreType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MaterializationStoreType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("MaterializationStoreType", 0u32, "None"), - Self::Online => serializer.serialize_unit_variant("MaterializationStoreType", 1u32, "Online"), - Self::Offline => serializer.serialize_unit_variant("MaterializationStoreType", 2u32, "Offline"), - Self::OnlineAndOffline => serializer.serialize_unit_variant("MaterializationStoreType", 3u32, "OnlineAndOffline"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Media type of data asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MediaType")] -pub enum MediaType { - Image, - Text, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MediaType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MediaType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MediaType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Image => serializer.serialize_unit_variant("MediaType", 0u32, "Image"), - Self::Text => serializer.serialize_unit_variant("MediaType", 1u32, "Text"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Defines an early termination policy based on running averages of the primary metric of all runs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MedianStoppingPolicy { - #[serde(flatten)] - pub early_termination_policy: EarlyTerminationPolicy, -} -impl MedianStoppingPolicy { - pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { - Self { early_termination_policy } - } -} -#[doc = "Model configuration options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelConfiguration { - #[doc = "Mounting type of the model or the inputs"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Relative mounting path of the model in the target image."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, -} -impl ModelConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelContainer { - #[serde(flatten)] - pub asset_container: AssetContainer, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl ModelContainer { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelContainerResource { - #[serde(flatten)] - pub resource: Resource, - pub properties: ModelContainer, -} -impl ModelContainerResource { - pub fn new(properties: ModelContainer) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ModelContainer entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelContainerResourceArmPaginatedResult { - #[doc = "The link to the next page of ModelContainer objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ModelContainer."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ModelContainerResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ModelContainerResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model package input options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelPackageInput { - #[doc = "Type of the inputs."] - #[serde(rename = "inputType")] - pub input_type: PackageInputType, - #[doc = "Mounting type of the model or the inputs"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Relative mount path of the input in the target image."] - #[serde(rename = "mountPath", default, skip_serializing_if = "Option::is_none")] - pub mount_path: Option, - pub path: PackageInputPathBaseUnion, -} -impl ModelPackageInput { - pub fn new(input_type: PackageInputType, path: PackageInputPathBaseUnion) -> Self { - Self { - input_type, - mode: None, - mount_path: None, - path, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelPerformanceMetricThresholdBase { - #[serde(rename = "modelType")] - pub model_type: MonitoringModelType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl ModelPerformanceMetricThresholdBase { - pub fn new(model_type: MonitoringModelType) -> Self { - Self { - model_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "modelType")] -pub enum ModelPerformanceMetricThresholdBaseUnion { - Classification(ClassificationModelPerformanceMetricThreshold), - Regression(RegressionModelPerformanceMetricThreshold), -} -#[doc = "Model performance signal definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelPerformanceSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[serde(rename = "dataSegment", default, skip_serializing_if = "Option::is_none")] - pub data_segment: Option, - #[serde(rename = "metricThreshold")] - pub metric_threshold: ModelPerformanceMetricThresholdBaseUnion, - #[doc = "[Required] The data produced by the production service which drift will be calculated for."] - #[serde(rename = "productionData")] - pub production_data: Vec, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBaseUnion, -} -impl ModelPerformanceSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_threshold: ModelPerformanceMetricThresholdBaseUnion, - production_data: Vec, - reference_data: MonitoringInputDataBaseUnion, - ) -> Self { - Self { - monitoring_signal_base, - data_segment: None, - metric_threshold, - production_data, - reference_data, - } - } -} -#[doc = "Image model size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ModelSize")] -pub enum ModelSize { - None, - Small, - Medium, - Large, - ExtraLarge, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ModelSize { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ModelSize { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ModelSize { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ModelSize", 0u32, "None"), - Self::Small => serializer.serialize_unit_variant("ModelSize", 1u32, "Small"), - Self::Medium => serializer.serialize_unit_variant("ModelSize", 2u32, "Medium"), - Self::Large => serializer.serialize_unit_variant("ModelSize", 3u32, "Large"), - Self::ExtraLarge => serializer.serialize_unit_variant("ModelSize", 4u32, "ExtraLarge"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Model task type enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ModelTaskType")] -pub enum ModelTaskType { - Classification, - Regression, - QuestionAnswering, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ModelTaskType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ModelTaskType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ModelTaskType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("ModelTaskType", 0u32, "Classification"), - Self::Regression => serializer.serialize_unit_variant("ModelTaskType", 1u32, "Regression"), - Self::QuestionAnswering => serializer.serialize_unit_variant("ModelTaskType", 2u32, "QuestionAnswering"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Model asset version details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelVersion { - #[serde(flatten)] - pub asset_base: AssetBase, - #[doc = "Mapping of model flavors to their properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flavors: Option, - #[doc = "Intellectual Property details for a resource."] - #[serde(rename = "intellectualProperty", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property: Option, - #[doc = "Name of the training job which produced this model"] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option, - #[doc = "The storage format for this entity. Used for NCD."] - #[serde(rename = "modelType", default, skip_serializing_if = "Option::is_none")] - pub model_type: Option, - #[doc = "The URI path to the model contents."] - #[serde(rename = "modelUri", default, skip_serializing_if = "Option::is_none")] - pub model_uri: Option, - #[doc = "Provisioning state of registry asset."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Stage in the model lifecycle assigned to this model"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, -} -impl ModelVersion { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ModelVersionResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Model asset version details."] - pub properties: ModelVersion, -} -impl ModelVersionResource { - pub fn new(properties: ModelVersion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of ModelVersion entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ModelVersionResourceArmPaginatedResult { - #[doc = "The link to the next page of ModelVersion objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type ModelVersion."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ModelVersionResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ModelVersionResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Monitor compute configuration base definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitorComputeConfigurationBase { - #[doc = "Monitor compute type enum."] - #[serde(rename = "computeType")] - pub compute_type: MonitorComputeType, -} -impl MonitorComputeConfigurationBase { - pub fn new(compute_type: MonitorComputeType) -> Self { - Self { compute_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "computeType")] -pub enum MonitorComputeConfigurationBaseUnion { - ServerlessSpark(MonitorServerlessSparkCompute), -} -#[doc = "Monitor compute identity base definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitorComputeIdentityBase { - #[doc = "Monitor compute identity type enum."] - #[serde(rename = "computeIdentityType")] - pub compute_identity_type: MonitorComputeIdentityType, -} -impl MonitorComputeIdentityBase { - pub fn new(compute_identity_type: MonitorComputeIdentityType) -> Self { - Self { compute_identity_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "computeIdentityType")] -pub enum MonitorComputeIdentityBaseUnion { - AmlToken(AmlTokenComputeIdentity), - ManagedIdentity(ManagedComputeIdentity), -} -#[doc = "Monitor compute identity type enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitorComputeIdentityType")] -pub enum MonitorComputeIdentityType { - AmlToken, - ManagedIdentity, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitorComputeIdentityType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitorComputeIdentityType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitorComputeIdentityType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AmlToken => serializer.serialize_unit_variant("MonitorComputeIdentityType", 0u32, "AmlToken"), - Self::ManagedIdentity => serializer.serialize_unit_variant("MonitorComputeIdentityType", 1u32, "ManagedIdentity"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Monitor compute type enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitorComputeType")] -pub enum MonitorComputeType { - ServerlessSpark, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitorComputeType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitorComputeType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitorComputeType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ServerlessSpark => serializer.serialize_unit_variant("MonitorComputeType", 0u32, "ServerlessSpark"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitorDefinition { - #[serde(rename = "alertNotificationSetting", default, skip_serializing_if = "Option::is_none")] - pub alert_notification_setting: Option, - #[doc = "Monitor compute configuration base definition."] - #[serde(rename = "computeConfiguration")] - pub compute_configuration: MonitorComputeConfigurationBaseUnion, - #[doc = "Monitoring target definition."] - #[serde(rename = "monitoringTarget", default, skip_serializing_if = "Option::is_none")] - pub monitoring_target: Option, - #[doc = "[Required] The signals to monitor."] - pub signals: serde_json::Value, -} -impl MonitorDefinition { - pub fn new(compute_configuration: MonitorComputeConfigurationBaseUnion, signals: serde_json::Value) -> Self { - Self { - alert_notification_setting: None, - compute_configuration, - monitoring_target: None, - signals, - } - } -} -#[doc = "Monitor serverless spark compute definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitorServerlessSparkCompute { - #[serde(flatten)] - pub monitor_compute_configuration_base: MonitorComputeConfigurationBase, - #[doc = "Monitor compute identity base definition."] - #[serde(rename = "computeIdentity")] - pub compute_identity: MonitorComputeIdentityBaseUnion, - #[doc = "[Required] The instance type running the Spark job."] - #[serde(rename = "instanceType")] - pub instance_type: String, - #[doc = "[Required] The Spark runtime version."] - #[serde(rename = "runtimeVersion")] - pub runtime_version: String, -} -impl MonitorServerlessSparkCompute { - pub fn new( - monitor_compute_configuration_base: MonitorComputeConfigurationBase, - compute_identity: MonitorComputeIdentityBaseUnion, - instance_type: String, - runtime_version: String, - ) -> Self { - Self { - monitor_compute_configuration_base, - compute_identity, - instance_type, - runtime_version, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringAlertNotificationSettingsBase { - #[serde(rename = "alertNotificationType")] - pub alert_notification_type: MonitoringAlertNotificationType, -} -impl MonitoringAlertNotificationSettingsBase { - pub fn new(alert_notification_type: MonitoringAlertNotificationType) -> Self { - Self { alert_notification_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "alertNotificationType")] -pub enum MonitoringAlertNotificationSettingsBaseUnion { - AzureMonitor(AzMonMonitoringAlertNotificationSettings), - Email(EmailMonitoringAlertNotificationSettings), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringAlertNotificationType")] -pub enum MonitoringAlertNotificationType { - AzureMonitor, - Email, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringAlertNotificationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringAlertNotificationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringAlertNotificationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureMonitor => serializer.serialize_unit_variant("MonitoringAlertNotificationType", 0u32, "AzureMonitor"), - Self::Email => serializer.serialize_unit_variant("MonitoringAlertNotificationType", 1u32, "Email"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MonitoringDataSegment { - #[doc = "The feature to segment the data on."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feature: Option, - #[doc = "Filters for only the specified values of the given segmented feature."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub values: Vec, -} -impl MonitoringDataSegment { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringFeatureDataType")] -pub enum MonitoringFeatureDataType { - Numerical, - Categorical, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringFeatureDataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringFeatureDataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringFeatureDataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Numerical => serializer.serialize_unit_variant("MonitoringFeatureDataType", 0u32, "Numerical"), - Self::Categorical => serializer.serialize_unit_variant("MonitoringFeatureDataType", 1u32, "Categorical"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringFeatureFilterBase { - #[serde(rename = "filterType")] - pub filter_type: MonitoringFeatureFilterType, -} -impl MonitoringFeatureFilterBase { - pub fn new(filter_type: MonitoringFeatureFilterType) -> Self { - Self { filter_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "filterType")] -pub enum MonitoringFeatureFilterBaseUnion { - AllFeatures(AllFeatures), - FeatureSubset(FeatureSubset), - TopNByAttribution(TopNFeaturesByAttribution), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringFeatureFilterType")] -pub enum MonitoringFeatureFilterType { - AllFeatures, - TopNByAttribution, - FeatureSubset, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringFeatureFilterType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringFeatureFilterType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringFeatureFilterType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AllFeatures => serializer.serialize_unit_variant("MonitoringFeatureFilterType", 0u32, "AllFeatures"), - Self::TopNByAttribution => serializer.serialize_unit_variant("MonitoringFeatureFilterType", 1u32, "TopNByAttribution"), - Self::FeatureSubset => serializer.serialize_unit_variant("MonitoringFeatureFilterType", 2u32, "FeatureSubset"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Monitoring input data base definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringInputDataBase { - #[doc = "Mapping of column names to special uses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub columns: Option, - #[doc = "The context metadata of the data source."] - #[serde(rename = "dataContext", default, skip_serializing_if = "Option::is_none")] - pub data_context: Option, - #[doc = "Monitoring input data type enum."] - #[serde(rename = "inputDataType")] - pub input_data_type: MonitoringInputDataType, - #[doc = "Enum to determine the Job Input Type."] - #[serde(rename = "jobInputType")] - pub job_input_type: JobInputType, - #[doc = "[Required] Input Asset URI."] - pub uri: String, -} -impl MonitoringInputDataBase { - pub fn new(input_data_type: MonitoringInputDataType, job_input_type: JobInputType, uri: String) -> Self { - Self { - columns: None, - data_context: None, - input_data_type, - job_input_type, - uri, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "inputDataType")] -pub enum MonitoringInputDataBaseUnion { - Fixed(FixedInputData), - Static(StaticInputData), - Trailing(TrailingInputData), -} -#[doc = "Monitoring input data type enum."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringInputDataType")] -pub enum MonitoringInputDataType { - Static, - Trailing, - Fixed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringInputDataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringInputDataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringInputDataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Static => serializer.serialize_unit_variant("MonitoringInputDataType", 0u32, "Static"), - Self::Trailing => serializer.serialize_unit_variant("MonitoringInputDataType", 1u32, "Trailing"), - Self::Fixed => serializer.serialize_unit_variant("MonitoringInputDataType", 2u32, "Fixed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringModelType")] -pub enum MonitoringModelType { - Classification, - Regression, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringModelType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringModelType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringModelType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("MonitoringModelType", 0u32, "Classification"), - Self::Regression => serializer.serialize_unit_variant("MonitoringModelType", 1u32, "Regression"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringNotificationMode")] -pub enum MonitoringNotificationMode { - Disabled, - Enabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringNotificationMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringNotificationMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringNotificationMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("MonitoringNotificationMode", 0u32, "Disabled"), - Self::Enabled => serializer.serialize_unit_variant("MonitoringNotificationMode", 1u32, "Enabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringSignalBase { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "Property dictionary. Properties can be added, but not removed or altered."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[serde(rename = "signalType")] - pub signal_type: MonitoringSignalType, -} -impl MonitoringSignalBase { - pub fn new(signal_type: MonitoringSignalType) -> Self { - Self { - mode: None, - properties: None, - signal_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "signalType")] -pub enum MonitoringSignalBaseUnion { - Custom(CustomMonitoringSignal), - DataDrift(DataDriftMonitoringSignal), - DataQuality(DataQualityMonitoringSignal), - FeatureAttributionDrift(FeatureAttributionDriftMonitoringSignal), - GenerationSafetyQuality(GenerationSafetyQualityMonitoringSignal), - GenerationTokenStatistics(GenerationTokenStatisticsSignal), - ModelPerformance(ModelPerformanceSignal), - PredictionDrift(PredictionDriftMonitoringSignal), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MonitoringSignalType")] -pub enum MonitoringSignalType { - DataDrift, - PredictionDrift, - DataQuality, - FeatureAttributionDrift, - Custom, - ModelPerformance, - GenerationSafetyQuality, - GenerationTokenStatistics, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MonitoringSignalType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MonitoringSignalType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MonitoringSignalType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::DataDrift => serializer.serialize_unit_variant("MonitoringSignalType", 0u32, "DataDrift"), - Self::PredictionDrift => serializer.serialize_unit_variant("MonitoringSignalType", 1u32, "PredictionDrift"), - Self::DataQuality => serializer.serialize_unit_variant("MonitoringSignalType", 2u32, "DataQuality"), - Self::FeatureAttributionDrift => serializer.serialize_unit_variant("MonitoringSignalType", 3u32, "FeatureAttributionDrift"), - Self::Custom => serializer.serialize_unit_variant("MonitoringSignalType", 4u32, "Custom"), - Self::ModelPerformance => serializer.serialize_unit_variant("MonitoringSignalType", 5u32, "ModelPerformance"), - Self::GenerationSafetyQuality => serializer.serialize_unit_variant("MonitoringSignalType", 6u32, "GenerationSafetyQuality"), - Self::GenerationTokenStatistics => serializer.serialize_unit_variant("MonitoringSignalType", 7u32, "GenerationTokenStatistics"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Monitoring target definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MonitoringTarget { - #[doc = "The ARM resource ID of either the deployment targeted by this monitor."] - #[serde(rename = "deploymentId", default, skip_serializing_if = "Option::is_none")] - pub deployment_id: Option, - #[doc = "The ARM resource ID of either the model targeted by this monitor."] - #[serde(rename = "modelId", default, skip_serializing_if = "Option::is_none")] - pub model_id: Option, - #[doc = "Model task type enum."] - #[serde(rename = "taskType")] - pub task_type: ModelTaskType, -} -impl MonitoringTarget { - pub fn new(task_type: ModelTaskType) -> Self { - Self { - deployment_id: None, - model_id: None, - task_type, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MonitoringThreshold { - #[doc = "The threshold value. If null, the set default is dependent on the metric type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl MonitoringThreshold { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Monitoring workspace connection definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MonitoringWorkspaceConnection { - #[doc = "The properties of a workspace service connection to store as environment variables in the submitted jobs.\r\nKey is workspace connection property path, name is environment variable key."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[doc = "The properties of a workspace service connection to store as secrets in the submitted jobs.\r\nKey is workspace connection property path, name is secret key."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub secrets: Option, -} -impl MonitoringWorkspaceConnection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "MPI distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Mpi { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of processes per MPI node."] - #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] - pub process_count_per_instance: Option, -} -impl Mpi { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - process_count_per_instance: None, - } - } -} -#[doc = "Whether multiSelect is enabled"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "MultiSelect")] -pub enum MultiSelect { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for MultiSelect { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for MultiSelect { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for MultiSelect { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("MultiSelect", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("MultiSelect", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "N-Cross validations value."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NCrossValidations { - #[doc = "Determines how N-Cross validations value is determined."] - pub mode: NCrossValidationsMode, -} -impl NCrossValidations { - pub fn new(mode: NCrossValidationsMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum NCrossValidationsUnion { - Auto(AutoNCrossValidations), - Custom(CustomNCrossValidations), -} -#[doc = "Determines how N-Cross validations value is determined."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NCrossValidationsMode")] -pub enum NCrossValidationsMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NCrossValidationsMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NCrossValidationsMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NCrossValidationsMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("NCrossValidationsMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("NCrossValidationsMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpFixedParameters { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum of learning rate schedulers that aligns with those supported by HF"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NlpLearningRateScheduler")] -pub enum NlpLearningRateScheduler { - None, - Linear, - Cosine, - CosineWithRestarts, - Polynomial, - Constant, - ConstantWithWarmup, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NlpLearningRateScheduler { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NlpLearningRateScheduler { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NlpLearningRateScheduler { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("NlpLearningRateScheduler", 0u32, "None"), - Self::Linear => serializer.serialize_unit_variant("NlpLearningRateScheduler", 1u32, "Linear"), - Self::Cosine => serializer.serialize_unit_variant("NlpLearningRateScheduler", 2u32, "Cosine"), - Self::CosineWithRestarts => serializer.serialize_unit_variant("NlpLearningRateScheduler", 3u32, "CosineWithRestarts"), - Self::Polynomial => serializer.serialize_unit_variant("NlpLearningRateScheduler", 4u32, "Polynomial"), - Self::Constant => serializer.serialize_unit_variant("NlpLearningRateScheduler", 5u32, "Constant"), - Self::ConstantWithWarmup => serializer.serialize_unit_variant("NlpLearningRateScheduler", 6u32, "ConstantWithWarmup"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stringified search spaces for each parameter. See below examples."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpParameterSubspace { - #[doc = "Number of steps to accumulate gradients over before running a backward pass."] - #[serde(rename = "gradientAccumulationSteps", default, skip_serializing_if = "Option::is_none")] - pub gradient_accumulation_steps: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "The type of learning rate schedule to use during the training procedure."] - #[serde(rename = "learningRateScheduler", default, skip_serializing_if = "Option::is_none")] - pub learning_rate_scheduler: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Number of training epochs."] - #[serde(rename = "numberOfEpochs", default, skip_serializing_if = "Option::is_none")] - pub number_of_epochs: Option, - #[doc = "The batch size for the training procedure."] - #[serde(rename = "trainingBatchSize", default, skip_serializing_if = "Option::is_none")] - pub training_batch_size: Option, - #[doc = "The batch size to be used during evaluation."] - #[serde(rename = "validationBatchSize", default, skip_serializing_if = "Option::is_none")] - pub validation_batch_size: Option, - #[doc = "The warmup ratio, used alongside LrSchedulerType."] - #[serde(rename = "warmupRatio", default, skip_serializing_if = "Option::is_none")] - pub warmup_ratio: Option, - #[doc = "The weight decay for the training procedure."] - #[serde(rename = "weightDecay", default, skip_serializing_if = "Option::is_none")] - pub weight_decay: Option, -} -impl NlpParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Model sweeping and hyperparameter tuning related settings."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NlpSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl NlpSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for NLP related AutoML tasks.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVertical { - #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] - pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML NLP training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, - #[doc = "Job execution constraints."] - #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] - pub limit_settings: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[doc = "Model sweeping and hyperparameter tuning related settings."] - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, -} -impl NlpVertical { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVerticalFeaturizationSettings { - #[serde(flatten)] - pub featurization_settings: FeaturizationSettings, -} -impl NlpVerticalFeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Job execution constraints."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NlpVerticalLimitSettings { - #[doc = "Maximum Concurrent AutoML iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, - #[doc = "Number of AutoML iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[doc = "Timeout for individual HD trials."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl NlpVerticalLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Counts of various compute node states on the amlCompute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NodeStateCounts { - #[doc = "Number of compute nodes in idle state."] - #[serde(rename = "idleNodeCount", default, skip_serializing_if = "Option::is_none")] - pub idle_node_count: Option, - #[doc = "Number of compute nodes which are running jobs."] - #[serde(rename = "runningNodeCount", default, skip_serializing_if = "Option::is_none")] - pub running_node_count: Option, - #[doc = "Number of compute nodes which are being prepared."] - #[serde(rename = "preparingNodeCount", default, skip_serializing_if = "Option::is_none")] - pub preparing_node_count: Option, - #[doc = "Number of compute nodes which are in unusable state."] - #[serde(rename = "unusableNodeCount", default, skip_serializing_if = "Option::is_none")] - pub unusable_node_count: Option, - #[doc = "Number of compute nodes which are leaving the amlCompute."] - #[serde(rename = "leavingNodeCount", default, skip_serializing_if = "Option::is_none")] - pub leaving_node_count: Option, - #[doc = "Number of compute nodes which are in preempted state."] - #[serde(rename = "preemptedNodeCount", default, skip_serializing_if = "Option::is_none")] - pub preempted_node_count: Option, -} -impl NodeStateCounts { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Abstract Nodes definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Nodes { - #[doc = "The enumerated types for the nodes value"] - #[serde(rename = "nodesValueType")] - pub nodes_value_type: NodesValueType, -} -impl Nodes { - pub fn new(nodes_value_type: NodesValueType) -> Self { - Self { nodes_value_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "nodesValueType")] -pub enum NodesUnion { - All(AllNodes), -} -#[doc = "The enumerated types for the nodes value"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NodesValueType")] -pub enum NodesValueType { - All, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NodesValueType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NodesValueType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NodesValueType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::All => serializer.serialize_unit_variant("NodesValueType", 0u32, "All"), - Self::Custom => serializer.serialize_unit_variant("NodesValueType", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NoneAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, -} -impl NoneAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - } - } -} -#[doc = "Empty/none datastore credentials."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NoneDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, -} -impl NoneDatastoreCredentials { - pub fn new(datastore_credentials: DatastoreCredentials) -> Self { - Self { datastore_credentials } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookAccessTokenResult { - #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")] - pub access_token: Option, - #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] - pub expires_in: Option, - #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] - pub host_name: Option, - #[serde(rename = "notebookResourceId", default, skip_serializing_if = "Option::is_none")] - pub notebook_resource_id: Option, - #[serde(rename = "publicDns", default, skip_serializing_if = "Option::is_none")] - pub public_dns: Option, - #[serde(rename = "refreshToken", default, skip_serializing_if = "Option::is_none")] - pub refresh_token: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option, -} -impl NotebookAccessTokenResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookPreparationError { - #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[serde(rename = "statusCode", default, skip_serializing_if = "Option::is_none")] - pub status_code: Option, -} -impl NotebookPreparationError { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotebookResourceInfo { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fqdn: Option, - #[serde(rename = "isPrivateLinkEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_private_link_enabled: Option, - #[serde(rename = "notebookPreparationError", default, skip_serializing_if = "Option::is_none")] - pub notebook_preparation_error: Option, - #[doc = "the data plane resourceId that used to initialize notebook component"] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl NotebookResourceInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configuration for notification."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NotificationSetting { - #[doc = "Send email notification to user on specified notification type"] - #[serde( - rename = "emailOn", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub email_on: Vec, - #[doc = "This is the email recipient list which has a limitation of 499 characters in total concat with comma separator"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub emails: Vec, - #[doc = "Send webhook callback to a service. Key is a user-provided name for the webhook."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub webhooks: Option, -} -impl NotificationSetting { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NumericalDataDriftMetric")] -pub enum NumericalDataDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - NormalizedWassersteinDistance, - TwoSampleKolmogorovSmirnovTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NumericalDataDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NumericalDataDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NumericalDataDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => serializer.serialize_unit_variant("NumericalDataDriftMetric", 0u32, "JensenShannonDistance"), - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("NumericalDataDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::NormalizedWassersteinDistance => { - serializer.serialize_unit_variant("NumericalDataDriftMetric", 2u32, "NormalizedWassersteinDistance") - } - Self::TwoSampleKolmogorovSmirnovTest => { - serializer.serialize_unit_variant("NumericalDataDriftMetric", 3u32, "TwoSampleKolmogorovSmirnovTest") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NumericalDataDriftMetricThreshold { - #[serde(flatten)] - pub data_drift_metric_threshold_base: DataDriftMetricThresholdBase, - pub metric: NumericalDataDriftMetric, -} -impl NumericalDataDriftMetricThreshold { - pub fn new(data_drift_metric_threshold_base: DataDriftMetricThresholdBase, metric: NumericalDataDriftMetric) -> Self { - Self { - data_drift_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NumericalDataQualityMetric")] -pub enum NumericalDataQualityMetric { - NullValueRate, - DataTypeErrorRate, - OutOfBoundsRate, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NumericalDataQualityMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NumericalDataQualityMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NumericalDataQualityMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NullValueRate => serializer.serialize_unit_variant("NumericalDataQualityMetric", 0u32, "NullValueRate"), - Self::DataTypeErrorRate => serializer.serialize_unit_variant("NumericalDataQualityMetric", 1u32, "DataTypeErrorRate"), - Self::OutOfBoundsRate => serializer.serialize_unit_variant("NumericalDataQualityMetric", 2u32, "OutOfBoundsRate"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NumericalDataQualityMetricThreshold { - #[serde(flatten)] - pub data_quality_metric_threshold_base: DataQualityMetricThresholdBase, - pub metric: NumericalDataQualityMetric, -} -impl NumericalDataQualityMetricThreshold { - pub fn new(data_quality_metric_threshold_base: DataQualityMetricThresholdBase, metric: NumericalDataQualityMetric) -> Self { - Self { - data_quality_metric_threshold_base, - metric, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "NumericalPredictionDriftMetric")] -pub enum NumericalPredictionDriftMetric { - JensenShannonDistance, - PopulationStabilityIndex, - NormalizedWassersteinDistance, - TwoSampleKolmogorovSmirnovTest, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for NumericalPredictionDriftMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for NumericalPredictionDriftMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for NumericalPredictionDriftMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::JensenShannonDistance => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 0u32, "JensenShannonDistance") - } - Self::PopulationStabilityIndex => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 1u32, "PopulationStabilityIndex") - } - Self::NormalizedWassersteinDistance => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 2u32, "NormalizedWassersteinDistance") - } - Self::TwoSampleKolmogorovSmirnovTest => { - serializer.serialize_unit_variant("NumericalPredictionDriftMetric", 3u32, "TwoSampleKolmogorovSmirnovTest") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NumericalPredictionDriftMetricThreshold { - #[serde(flatten)] - pub prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, - pub metric: NumericalPredictionDriftMetric, -} -impl NumericalPredictionDriftMetricThreshold { - pub fn new(prediction_drift_metric_threshold_base: PredictionDriftMetricThresholdBase, metric: NumericalPredictionDriftMetric) -> Self { - Self { - prediction_drift_metric_threshold_base, - metric, - } - } -} -#[doc = "Primary metrics for Image ObjectDetection task."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ObjectDetectionPrimaryMetrics")] -pub enum ObjectDetectionPrimaryMetrics { - MeanAveragePrecision, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ObjectDetectionPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ObjectDetectionPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ObjectDetectionPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAveragePrecision => serializer.serialize_unit_variant("ObjectDetectionPrimaryMetrics", 0u32, "MeanAveragePrecision"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Optimization objective."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Objective { - #[doc = "Defines supported metric goals for hyperparameter tuning"] - pub goal: Goal, - #[doc = "[Required] Name of the metric to optimize."] - #[serde(rename = "primaryMetric")] - pub primary_metric: String, -} -impl Objective { - pub fn new(goal: Goal, primary_metric: String) -> Self { - Self { goal, primary_metric } - } -} -#[doc = "OneLake artifact (data source) configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OneLakeArtifact { - #[doc = "[Required] OneLake artifact name"] - #[serde(rename = "artifactName")] - pub artifact_name: String, - #[doc = "Enum to determine OneLake artifact type."] - #[serde(rename = "artifactType")] - pub artifact_type: OneLakeArtifactType, -} -impl OneLakeArtifact { - pub fn new(artifact_name: String, artifact_type: OneLakeArtifactType) -> Self { - Self { - artifact_name, - artifact_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "artifactType")] -pub enum OneLakeArtifactUnion { - LakeHouse(LakeHouseArtifact), -} -#[doc = "Enum to determine OneLake artifact type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OneLakeArtifactType")] -pub enum OneLakeArtifactType { - LakeHouse, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OneLakeArtifactType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OneLakeArtifactType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OneLakeArtifactType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::LakeHouse => serializer.serialize_unit_variant("OneLakeArtifactType", 0u32, "LakeHouse"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "OneLake (Trident) datastore configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OneLakeDatastore { - #[serde(flatten)] - pub datastore: Datastore, - #[doc = "OneLake artifact (data source) configuration."] - pub artifact: OneLakeArtifactUnion, - #[doc = "OneLake endpoint to use for the datastore."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option, - #[doc = "[Required] OneLake workspace name."] - #[serde(rename = "oneLakeWorkspaceName")] - pub one_lake_workspace_name: String, - #[serde(rename = "serviceDataAccessAuthIdentity", default, skip_serializing_if = "Option::is_none")] - pub service_data_access_auth_identity: Option, -} -impl OneLakeDatastore { - pub fn new(datastore: Datastore, artifact: OneLakeArtifactUnion, one_lake_workspace_name: String) -> Self { - Self { - datastore, - artifact, - endpoint: None, - one_lake_workspace_name, - service_data_access_auth_identity: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineDeployment { - #[serde(flatten)] - pub endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase, - #[doc = "If true, enables Application Insights logging."] - #[serde(rename = "appInsightsEnabled", default, skip_serializing_if = "Option::is_none")] - pub app_insights_enabled: Option, - #[serde(rename = "dataCollector", default, skip_serializing_if = "Option::is_none")] - pub data_collector: Option, - #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment."] - #[serde(rename = "egressPublicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub egress_public_network_access: Option, - #[doc = "Enum to determine endpoint compute type."] - #[serde(rename = "endpointComputeType")] - pub endpoint_compute_type: EndpointComputeType, - #[doc = "Compute instance type."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Deployment container liveness/readiness probe configuration."] - #[serde(rename = "livenessProbe", default, skip_serializing_if = "Option::is_none")] - pub liveness_probe: Option, - #[doc = "The URI path to the model."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub model: Option, - #[doc = "The path to mount the model in custom container."] - #[serde(rename = "modelMountPath", default, skip_serializing_if = "Option::is_none")] - pub model_mount_path: Option, - #[doc = "Possible values for DeploymentProvisioningState."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Deployment container liveness/readiness probe configuration."] - #[serde(rename = "readinessProbe", default, skip_serializing_if = "Option::is_none")] - pub readiness_probe: Option, - #[doc = "Online deployment scoring requests configuration."] - #[serde(rename = "requestSettings", default, skip_serializing_if = "Option::is_none")] - pub request_settings: Option, - #[doc = "Online deployment scaling configuration."] - #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, -} -impl OnlineDeployment { - pub fn new(endpoint_compute_type: EndpointComputeType) -> Self { - Self { - endpoint_deployment_properties_base: EndpointDeploymentPropertiesBase::default(), - app_insights_enabled: None, - data_collector: None, - egress_public_network_access: None, - endpoint_compute_type, - instance_type: None, - liveness_probe: None, - model: None, - model_mount_path: None, - provisioning_state: None, - readiness_probe: None, - request_settings: None, - scale_settings: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "endpointComputeType")] -pub enum OnlineDeploymentUnion { - Kubernetes(KubernetesOnlineDeployment), - Managed(ManagedOnlineDeployment), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineDeploymentTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - pub properties: OnlineDeploymentUnion, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl OnlineDeploymentTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: OnlineDeploymentUnion) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of OnlineDeployment entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineDeploymentTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of OnlineDeployment objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type OnlineDeployment."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for OnlineDeploymentTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OnlineDeploymentTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online endpoint configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineEndpoint { - #[serde(flatten)] - pub endpoint_properties_base: EndpointPropertiesBase, - #[doc = "ARM resource ID of the compute if it exists.\r\noptional"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compute: Option, - #[doc = "Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50."] - #[serde(rename = "mirrorTraffic", default, skip_serializing_if = "Option::is_none")] - pub mirror_traffic: Option, - #[doc = "State of endpoint provisioning."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub traffic: Option, -} -impl OnlineEndpoint { - pub fn new(endpoint_properties_base: EndpointPropertiesBase) -> Self { - Self { - endpoint_properties_base, - compute: None, - mirror_traffic: None, - provisioning_state: None, - public_network_access: None, - traffic: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineEndpointTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Online endpoint configuration"] - pub properties: OnlineEndpoint, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl OnlineEndpointTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: OnlineEndpoint) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of OnlineEndpoint entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineEndpointTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of OnlineEndpoint objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type OnlineEndpoint."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for OnlineEndpointTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OnlineEndpointTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online inference configuration options."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineInferenceConfiguration { - #[doc = "Additional configurations"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configurations: Option, - #[doc = "Entry script or command to invoke."] - #[serde(rename = "entryScript", default, skip_serializing_if = "Option::is_none")] - pub entry_script: Option, - #[serde(rename = "livenessRoute", default, skip_serializing_if = "Option::is_none")] - pub liveness_route: Option, - #[serde(rename = "readinessRoute", default, skip_serializing_if = "Option::is_none")] - pub readiness_route: Option, - #[serde(rename = "scoringRoute", default, skip_serializing_if = "Option::is_none")] - pub scoring_route: Option, -} -impl OnlineInferenceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online deployment scoring requests configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OnlineRequestSettings { - #[doc = "The number of maximum concurrent requests per node allowed per deployment. Defaults to 1."] - #[serde(rename = "maxConcurrentRequestsPerInstance", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_requests_per_instance: Option, - #[doc = "The maximum amount of time a request will stay in the queue in ISO 8601 format.\r\nDefaults to 500ms."] - #[serde(rename = "maxQueueWait", default, skip_serializing_if = "Option::is_none")] - pub max_queue_wait: Option, - #[doc = "The scoring timeout in ISO 8601 format.\r\nDefaults to 5000ms."] - #[serde(rename = "requestTimeout", default, skip_serializing_if = "Option::is_none")] - pub request_timeout: Option, -} -impl OnlineRequestSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Online deployment scaling configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnlineScaleSettings { - #[serde(rename = "scaleType")] - pub scale_type: ScaleType, -} -impl OnlineScaleSettings { - pub fn new(scale_type: ScaleType) -> Self { - Self { scale_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "scaleType")] -pub enum OnlineScaleSettingsUnion { - Default(DefaultScaleSettings), - TargetUtilization(TargetUtilizationScaleSettings), -} -#[doc = "The type of operating system."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OperatingSystemType")] -pub enum OperatingSystemType { - Linux, - Windows, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OperatingSystemType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OperatingSystemType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OperatingSystemType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Linux => serializer.serialize_unit_variant("OperatingSystemType", 0u32, "Linux"), - Self::Windows => serializer.serialize_unit_variant("OperatingSystemType", 1u32, "Windows"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Display name of operation"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OperationDisplay { - #[doc = "Gets or sets the description for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Gets or sets the operation that users can perform."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, - #[doc = "Gets or sets the resource provider name:\r\nMicrosoft.MachineLearningExperimentation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[doc = "Gets or sets the resource on which the operation is performed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, -} -impl OperationDisplay { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OrderString")] -pub enum OrderString { - CreatedAtDesc, - CreatedAtAsc, - UpdatedAtDesc, - UpdatedAtAsc, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OrderString { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OrderString { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OrderString { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreatedAtDesc => serializer.serialize_unit_variant("OrderString", 0u32, "CreatedAtDesc"), - Self::CreatedAtAsc => serializer.serialize_unit_variant("OrderString", 1u32, "CreatedAtAsc"), - Self::UpdatedAtDesc => serializer.serialize_unit_variant("OrderString", 2u32, "UpdatedAtDesc"), - Self::UpdatedAtAsc => serializer.serialize_unit_variant("OrderString", 3u32, "UpdatedAtAsc"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutboundRule { - #[doc = "Category of a managed network Outbound Rule of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[doc = "Type of a managed network Outbound Rule of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Type of a managed network Outbound Rule of a machine learning workspace."] - #[serde(rename = "type")] - pub type_: RuleType, -} -impl OutboundRule { - pub fn new(type_: RuleType) -> Self { - Self { - category: None, - status: None, - type_, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "type")] -pub enum OutboundRuleUnion { - #[serde(rename = "FQDN")] - Fqdn(FqdnOutboundRule), - PrivateEndpoint(PrivateEndpointOutboundRule), - ServiceTag(ServiceTagOutboundRule), -} -#[doc = "Outbound Rule Basic Resource for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutboundRuleBasicResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Outbound Rule for the managed network of a machine learning workspace."] - pub properties: OutboundRuleUnion, -} -impl OutboundRuleBasicResource { - pub fn new(properties: OutboundRuleUnion) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "List of outbound rules for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OutboundRuleListResult { - #[doc = "The link to the next page constructed using the continuationToken. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for OutboundRuleListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl OutboundRuleListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Output data delivery mode enums."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OutputDeliveryMode")] -pub enum OutputDeliveryMode { - ReadWriteMount, - Upload, - Direct, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OutputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OutputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OutputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ReadWriteMount => serializer.serialize_unit_variant("OutputDeliveryMode", 0u32, "ReadWriteMount"), - Self::Upload => serializer.serialize_unit_variant("OutputDeliveryMode", 1u32, "Upload"), - Self::Direct => serializer.serialize_unit_variant("OutputDeliveryMode", 2u32, "Direct"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Reference to an asset via its path in a job output."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutputPathAssetReference { - #[serde(flatten)] - pub asset_reference_base: AssetReferenceBase, - #[doc = "ARM resource ID of the job."] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "The path of the file/directory in the job output."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, -} -impl OutputPathAssetReference { - pub fn new(asset_reference_base: AssetReferenceBase) -> Self { - Self { - asset_reference_base, - job_id: None, - path: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl PatAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Package build state returned in package response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageBuildState")] -pub enum PackageBuildState { - NotStarted, - Running, - Succeeded, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageBuildState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageBuildState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageBuildState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotStarted => serializer.serialize_unit_variant("PackageBuildState", 0u32, "NotStarted"), - Self::Running => serializer.serialize_unit_variant("PackageBuildState", 1u32, "Running"), - Self::Succeeded => serializer.serialize_unit_variant("PackageBuildState", 2u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("PackageBuildState", 3u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Mounting type of the model or the inputs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageInputDeliveryMode")] -pub enum PackageInputDeliveryMode { - Copy, - Download, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageInputDeliveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageInputDeliveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageInputDeliveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Copy => serializer.serialize_unit_variant("PackageInputDeliveryMode", 0u32, "Copy"), - Self::Download => serializer.serialize_unit_variant("PackageInputDeliveryMode", 1u32, "Download"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathBase { - #[doc = "Input path type for package inputs."] - #[serde(rename = "inputPathType")] - pub input_path_type: InputPathType, -} -impl PackageInputPathBase { - pub fn new(input_path_type: InputPathType) -> Self { - Self { input_path_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "inputPathType")] -pub enum PackageInputPathBaseUnion { - PathId(PackageInputPathId), - Url(PackageInputPathUrl), - PathVersion(PackageInputPathVersion), -} -#[doc = "Package input path specified with a resource id."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathId { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input resource id."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl PackageInputPathId { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - resource_id: None, - } - } -} -#[doc = "Package input path specified as an url."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathUrl { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input path url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, -} -impl PackageInputPathUrl { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - url: None, - } - } -} -#[doc = "Package input path specified with name and version."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageInputPathVersion { - #[serde(flatten)] - pub package_input_path_base: PackageInputPathBase, - #[doc = "Input resource name."] - #[serde(rename = "resourceName", default, skip_serializing_if = "Option::is_none")] - pub resource_name: Option, - #[doc = "Input resource version."] - #[serde(rename = "resourceVersion", default, skip_serializing_if = "Option::is_none")] - pub resource_version: Option, -} -impl PackageInputPathVersion { - pub fn new(package_input_path_base: PackageInputPathBase) -> Self { - Self { - package_input_path_base, - resource_name: None, - resource_version: None, - } - } -} -#[doc = "Type of the inputs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PackageInputType")] -pub enum PackageInputType { - UriFile, - UriFolder, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PackageInputType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PackageInputType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PackageInputType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::UriFile => serializer.serialize_unit_variant("PackageInputType", 0u32, "UriFile"), - Self::UriFolder => serializer.serialize_unit_variant("PackageInputType", 1u32, "UriFolder"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Model package operation request properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PackageRequest { - #[serde(rename = "baseEnvironmentSource", default, skip_serializing_if = "Option::is_none")] - pub base_environment_source: Option, - #[doc = "Collection of environment variables."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(rename = "inferencingServer")] - pub inferencing_server: InferencingServerUnion, - #[doc = "Collection of inputs."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub inputs: Vec, - #[doc = "Model configuration options."] - #[serde(rename = "modelConfiguration", default, skip_serializing_if = "Option::is_none")] - pub model_configuration: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "[Required] Arm ID of the target environment to be created by package operation."] - #[serde(rename = "targetEnvironmentId")] - pub target_environment_id: String, -} -impl PackageRequest { - pub fn new(inferencing_server: InferencingServerUnion, target_environment_id: String) -> Self { - Self { - base_environment_source: None, - environment_variables: None, - inferencing_server, - inputs: Vec::new(), - model_configuration: None, - tags: None, - target_environment_id, - } - } -} -#[doc = "Package response returned after async package operation completes successfully."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PackageResponse { - #[serde(rename = "baseEnvironmentSource", default, skip_serializing_if = "Option::is_none")] - pub base_environment_source: Option, - #[doc = "Build id of the image build operation."] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option, - #[doc = "Package build state returned in package response."] - #[serde(rename = "buildState", default, skip_serializing_if = "Option::is_none")] - pub build_state: Option, - #[doc = "Collection of environment variables."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(rename = "inferencingServer", default, skip_serializing_if = "Option::is_none")] - pub inferencing_server: Option, - #[doc = "Collection of inputs."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub inputs: Vec, - #[doc = "Log url of the image build operation."] - #[serde(rename = "logUrl", default, skip_serializing_if = "Option::is_none")] - pub log_url: Option, - #[doc = "Model configuration options."] - #[serde(rename = "modelConfiguration", default, skip_serializing_if = "Option::is_none")] - pub model_configuration: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "Asset ID of the target environment created by package operation."] - #[serde(rename = "targetEnvironmentId", default, skip_serializing_if = "Option::is_none")] - pub target_environment_id: Option, -} -impl PackageResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Paginated list of Machine Learning compute objects wrapped in ARM resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PaginatedComputeResourcesList { - #[doc = "An array of Machine Learning compute objects wrapped in ARM resource envelope."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "A continuation link (absolute URI) to the next page of results in the list."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for PaginatedComputeResourcesList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl PaginatedComputeResourcesList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Mutable batch inference settings per deployment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialBatchDeployment { - #[doc = "Description of the endpoint deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl PartialBatchDeployment { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { - #[doc = "Mutable batch inference settings per deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Mutable base definition for a job."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialJobBase { - #[doc = "Mutable configuration for notification."] - #[serde(rename = "notificationSetting", default, skip_serializing_if = "Option::is_none")] - pub notification_setting: Option, -} -impl PartialJobBase { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Azure Resource Manager resource envelope strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialJobBasePartialResource { - #[doc = "Mutable base definition for a job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl PartialJobBasePartialResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialManagedServiceIdentity { - #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] - #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] - pub user_assigned_identities: Option, -} -impl PartialManagedServiceIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResource { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialMinimalTrackedResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResourceWithIdentity { - #[serde(flatten)] - pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, -} -impl PartialMinimalTrackedResourceWithIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialMinimalTrackedResourceWithSku { - #[serde(flatten)] - pub partial_minimal_tracked_resource: PartialMinimalTrackedResource, - #[doc = "Common SKU definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl PartialMinimalTrackedResourceWithSku { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Mutable configuration for notification."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialNotificationSetting { - #[doc = "Send webhook callback to a service. Key is a user-provided name for the webhook."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub webhooks: Option, -} -impl PartialNotificationSetting { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Partial Registry class for PATCH"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistry {} -impl PartialRegistry { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Strictly used in update requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialRegistryPartialTrackedResource { - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Common SKU definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PartialRegistryPartialTrackedResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common SKU definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialSku { - #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, - #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "The name of the SKU. Ex - P3. It is typically a letter+number code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, -} -impl PartialSku { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PartialUserAssignedIdentity {} -impl PartialUserAssignedIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Password { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl Password { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PendingUploadCredentialDto { - #[doc = "Enum to determine the PendingUpload credentials type."] - #[serde(rename = "credentialType")] - pub credential_type: PendingUploadCredentialType, -} -impl PendingUploadCredentialDto { - pub fn new(credential_type: PendingUploadCredentialType) -> Self { - Self { credential_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "credentialType")] -pub enum PendingUploadCredentialDtoUnion { - #[serde(rename = "SAS")] - Sas(SasCredentialDto), -} -#[doc = "Enum to determine the PendingUpload credentials type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PendingUploadCredentialType")] -pub enum PendingUploadCredentialType { - #[serde(rename = "SAS")] - Sas, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PendingUploadCredentialType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PendingUploadCredentialType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PendingUploadCredentialType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Sas => serializer.serialize_unit_variant("PendingUploadCredentialType", 0u32, "SAS"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PendingUploadRequestDto { - #[doc = "If PendingUploadId = null then random guid will be used."] - #[serde(rename = "pendingUploadId", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_id: Option, - #[doc = "Type of storage to use for the pending upload location"] - #[serde(rename = "pendingUploadType", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_type: Option, -} -impl PendingUploadRequestDto { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PendingUploadResponseDto { - #[serde(rename = "blobReferenceForConsumption", default, skip_serializing_if = "Option::is_none")] - pub blob_reference_for_consumption: Option, - #[doc = "ID for this upload request"] - #[serde(rename = "pendingUploadId", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_id: Option, - #[doc = "Type of storage to use for the pending upload location"] - #[serde(rename = "pendingUploadType", default, skip_serializing_if = "Option::is_none")] - pub pending_upload_type: Option, -} -impl PendingUploadResponseDto { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Type of storage to use for the pending upload location"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PendingUploadType")] -pub enum PendingUploadType { - None, - TemporaryBlobReference, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PendingUploadType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PendingUploadType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PendingUploadType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("PendingUploadType", 0u32, "None"), - Self::TemporaryBlobReference => serializer.serialize_unit_variant("PendingUploadType", 1u32, "TemporaryBlobReference"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Settings for a personal compute instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PersonalComputeInstanceSettings { - #[doc = "A user that can be assigned to a compute instance."] - #[serde(rename = "assignedUser", default, skip_serializing_if = "Option::is_none")] - pub assigned_user: Option, -} -impl PersonalComputeInstanceSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Pipeline Job definition: defines generic to MFE attributes."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PipelineJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Inputs for the pipeline job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jobs construct the Pipeline Job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jobs: Option, - #[doc = "Outputs for the pipeline job"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Pipeline settings, for things like ContinueRunOnStepFailure etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option, - #[doc = "ARM resource ID of source job."] - #[serde(rename = "sourceJobId", default, skip_serializing_if = "Option::is_none")] - pub source_job_id: Option, -} -impl PipelineJob { - pub fn new(job_base: JobBase) -> Self { - Self { - job_base, - inputs: None, - jobs: None, - outputs: None, - settings: None, - source_job_id: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PredictionDriftMetricThresholdBase { - #[serde(rename = "dataType")] - pub data_type: MonitoringFeatureDataType, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} -impl PredictionDriftMetricThresholdBase { - pub fn new(data_type: MonitoringFeatureDataType) -> Self { - Self { - data_type, - threshold: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "dataType")] -pub enum PredictionDriftMetricThresholdBaseUnion { - Categorical(CategoricalPredictionDriftMetricThreshold), - Numerical(NumericalPredictionDriftMetricThreshold), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PredictionDriftMonitoringSignal { - #[serde(flatten)] - pub monitoring_signal_base: MonitoringSignalBase, - #[doc = "[Required] A list of metrics to calculate and their associated thresholds."] - #[serde(rename = "metricThresholds")] - pub metric_thresholds: Vec, - #[serde(rename = "modelType")] - pub model_type: MonitoringModelType, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "productionData")] - pub production_data: MonitoringInputDataBaseUnion, - #[doc = "Monitoring input data base definition."] - #[serde(rename = "referenceData")] - pub reference_data: MonitoringInputDataBaseUnion, -} -impl PredictionDriftMonitoringSignal { - pub fn new( - monitoring_signal_base: MonitoringSignalBase, - metric_thresholds: Vec, - model_type: MonitoringModelType, - production_data: MonitoringInputDataBaseUnion, - reference_data: MonitoringInputDataBaseUnion, - ) -> Self { - Self { - monitoring_signal_base, - metric_thresholds, - model_type, - production_data, - reference_data, - } - } -} -#[doc = "The Private Endpoint resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpoint { - #[doc = "The ARM identifier for Private Endpoint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, -} -impl PrivateEndpoint { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The Private Endpoint Connection resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointConnection { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Same as workspace location."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Private endpoint connection properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PrivateEndpointConnection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "List of private endpoint connection associated with the specified workspace"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointConnectionListResult { - #[doc = "Array of private endpoint connections"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for PrivateEndpointConnectionListResult { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl PrivateEndpointConnectionListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Private endpoint connection properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointConnectionProperties { - #[doc = "The Private Endpoint resource."] - #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] - pub private_endpoint: Option, - #[doc = "A collection of information about the state of the connection between service consumer and provider."] - #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] - pub private_link_service_connection_state: Option, - #[doc = "The current provisioning state."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl PrivateEndpointConnectionProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The current provisioning state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PrivateEndpointConnectionProvisioningState")] -pub enum PrivateEndpointConnectionProvisioningState { - Succeeded, - Creating, - Deleting, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PrivateEndpointConnectionProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PrivateEndpointConnectionProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), - Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"), - Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointDestination { - #[serde(rename = "serviceResourceId", default, skip_serializing_if = "Option::is_none")] - pub service_resource_id: Option, - #[serde(rename = "sparkEnabled", default, skip_serializing_if = "Option::is_none")] - pub spark_enabled: Option, - #[doc = "Type of a managed network Outbound Rule of a machine learning workspace."] - #[serde(rename = "sparkStatus", default, skip_serializing_if = "Option::is_none")] - pub spark_status: Option, - #[serde(rename = "subresourceTarget", default, skip_serializing_if = "Option::is_none")] - pub subresource_target: Option, -} -impl PrivateEndpointDestination { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Private Endpoint Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PrivateEndpointOutboundRule { - #[serde(flatten)] - pub outbound_rule: OutboundRule, - #[doc = "Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, -} -impl PrivateEndpointOutboundRule { - pub fn new(outbound_rule: OutboundRule) -> Self { - Self { - outbound_rule, - destination: None, - } - } -} -#[doc = "The PE network resource that is linked to this PE connection."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateEndpointResource { - #[serde(flatten)] - pub private_endpoint: PrivateEndpoint, - #[doc = "The subnetId that the private endpoint is connected to."] - #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] - pub subnet_arm_id: Option, -} -impl PrivateEndpointResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Connection status of the service consumer with the service provider\r\nPossible state transitions\r\nPending -> Approved (Service provider approves the connection request)\r\nPending -> Rejected (Service provider rejects the connection request)\r\nPending -> Disconnected (Service provider deletes the connection)\r\nApproved -> Rejected (Service provider rejects the approved connection)\r\nApproved -> Disconnected (Service provider deletes the connection)\r\nRejected -> Pending (Service consumer re-initiates the connection request that was rejected)\r\nRejected -> Disconnected (Service provider deletes the connection)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PrivateEndpointServiceConnectionStatus")] -pub enum PrivateEndpointServiceConnectionStatus { - Approved, - Pending, - Rejected, - Disconnected, - Timeout, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PrivateEndpointServiceConnectionStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PrivateEndpointServiceConnectionStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Approved"), - Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Pending"), - Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"), - Self::Disconnected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 3u32, "Disconnected"), - Self::Timeout => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 4u32, "Timeout"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A private link resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Same as workspace location."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Properties of a private link resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PrivateLinkResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of private link resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResourceListResult { - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for PrivateLinkResourceListResult { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl PrivateLinkResourceListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a private link resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkResourceProperties { - #[doc = "The private link resource group id."] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option, - #[doc = "The private link resource required member names."] - #[serde( - rename = "requiredMembers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub required_members: Vec, - #[doc = "The private link resource Private link DNS zone name."] - #[serde( - rename = "requiredZoneNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub required_zone_names: Vec, -} -impl PrivateLinkResourceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A collection of information about the state of the connection between service consumer and provider."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PrivateLinkServiceConnectionState { - #[doc = "Some RP chose \"None\". Other RPs use this for region expansion."] - #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] - pub actions_required: Option, - #[doc = "User-defined message that, per NRP doc, may be used for approval-related message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Connection status of the service consumer with the service provider\r\nPossible state transitions\r\nPending -> Approved (Service provider approves the connection request)\r\nPending -> Rejected (Service provider rejects the connection request)\r\nPending -> Disconnected (Service provider deletes the connection)\r\nApproved -> Rejected (Service provider rejects the approved connection)\r\nApproved -> Disconnected (Service provider deletes the connection)\r\nRejected -> Pending (Service consumer re-initiates the connection request that was rejected)\r\nRejected -> Disconnected (Service provider deletes the connection)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl PrivateLinkServiceConnectionState { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Deployment container liveness/readiness probe configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProbeSettings { - #[doc = "The number of failures to allow before returning an unhealthy status."] - #[serde(rename = "failureThreshold", default, skip_serializing_if = "Option::is_none")] - pub failure_threshold: Option, - #[doc = "The delay before the first probe in ISO 8601 format."] - #[serde(rename = "initialDelay", default, skip_serializing_if = "Option::is_none")] - pub initial_delay: Option, - #[doc = "The length of time between probes in ISO 8601 format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub period: Option, - #[doc = "The number of successful probes before returning a healthy status."] - #[serde(rename = "successThreshold", default, skip_serializing_if = "Option::is_none")] - pub success_threshold: Option, - #[doc = "The probe timeout in ISO 8601 format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl ProbeSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Progress metrics definition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProgressMetrics { - #[doc = "The completed datapoint count."] - #[serde(rename = "completedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub completed_datapoint_count: Option, - #[doc = "The time of last successful incremental data refresh in UTC."] - #[serde(rename = "incrementalDataLastRefreshDateTime", default, with = "azure_core::date::rfc3339::option")] - pub incremental_data_last_refresh_date_time: Option, - #[doc = "The skipped datapoint count."] - #[serde(rename = "skippedDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub skipped_datapoint_count: Option, - #[doc = "The total datapoint count."] - #[serde(rename = "totalDatapointCount", default, skip_serializing_if = "Option::is_none")] - pub total_datapoint_count: Option, -} -impl ProgressMetrics { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Protection level associated with the Intellectual Property."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ProtectionLevel")] -pub enum ProtectionLevel { - All, - None, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ProtectionLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ProtectionLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ProtectionLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::All => serializer.serialize_unit_variant("ProtectionLevel", 0u32, "All"), - Self::None => serializer.serialize_unit_variant("ProtectionLevel", 1u32, "None"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ProvisioningState")] -pub enum ProvisioningState { - Unknown, - Updating, - Creating, - Deleting, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Unknown => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Unknown"), - Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), - Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Creating"), - Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum to determine whether PublicNetworkAccess is Enabled or Disabled."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "PublicNetworkAccessType")] -pub enum PublicNetworkAccessType { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for PublicNetworkAccessType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for PublicNetworkAccessType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for PublicNetworkAccessType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccessType", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccessType", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "PyTorch distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PyTorch { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of processes per node."] - #[serde(rename = "processCountPerInstance", default, skip_serializing_if = "Option::is_none")] - pub process_count_per_instance: Option, -} -impl PyTorch { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - process_count_per_instance: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueueSettings { - #[doc = "Enum to determine the job tier."] - #[serde(rename = "jobTier", default, skip_serializing_if = "Option::is_none")] - pub job_tier: Option, - #[doc = "Controls the priority of the job on a compute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option, -} -impl QueueSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties for Quota update or retrieval."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QuotaBaseProperties { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The maximum permitted quota of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "An enum describing the unit of quota measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, -} -impl QuotaBaseProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod quota_base_properties { - use super::*; - #[doc = "An enum describing the unit of quota measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Quota update parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QuotaUpdateParameters { - #[doc = "The list for update quota."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Region of workspace quota to be updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, -} -impl QuotaUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Defines a Sampling Algorithm that generates values randomly"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RandomSamplingAlgorithm { - #[serde(flatten)] - pub sampling_algorithm: SamplingAlgorithm, - #[doc = "An optional positive number or e in string format to be used as base for log based random sampling"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub logbase: Option, - #[doc = "The specific type of random algorithm"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rule: Option, - #[doc = "An optional integer to use as the seed for random number generation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub seed: Option, -} -impl RandomSamplingAlgorithm { - pub fn new(sampling_algorithm: SamplingAlgorithm) -> Self { - Self { - sampling_algorithm, - logbase: None, - rule: None, - seed: None, - } - } -} -#[doc = "The specific type of random algorithm"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RandomSamplingAlgorithmRule")] -pub enum RandomSamplingAlgorithmRule { - Random, - Sobol, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RandomSamplingAlgorithmRule { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RandomSamplingAlgorithmRule { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RandomSamplingAlgorithmRule { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Random => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 0u32, "Random"), - Self::Sobol => serializer.serialize_unit_variant("RandomSamplingAlgorithmRule", 1u32, "Sobol"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Ray distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Ray { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "The address of Ray head node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - #[doc = "The port to bind the dashboard server to."] - #[serde(rename = "dashboardPort", default, skip_serializing_if = "Option::is_none")] - pub dashboard_port: Option, - #[doc = "Additional arguments passed to ray start in head node."] - #[serde(rename = "headNodeAdditionalArgs", default, skip_serializing_if = "Option::is_none")] - pub head_node_additional_args: Option, - #[doc = "Provide this argument to start the Ray dashboard GUI."] - #[serde(rename = "includeDashboard", default, skip_serializing_if = "Option::is_none")] - pub include_dashboard: Option, - #[doc = "The port of the head ray process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "Additional arguments passed to ray start in worker node."] - #[serde(rename = "workerNodeAdditionalArgs", default, skip_serializing_if = "Option::is_none")] - pub worker_node_additional_args: Option, -} -impl Ray { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - address: None, - dashboard_port: None, - head_node_additional_args: None, - include_dashboard: None, - port: None, - worker_node_additional_args: None, - } - } -} -#[doc = "The workflow trigger recurrence for ComputeStartStop schedule type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Recurrence { - #[doc = "Enum to describe the frequency of a recurrence schedule"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub frequency: Option, - #[doc = "[Required] Specifies schedule interval in conjunction with frequency"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[doc = "The start time in yyyy-MM-ddTHH:mm:ss format."] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl Recurrence { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to describe the frequency of a recurrence schedule"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RecurrenceFrequency")] -pub enum RecurrenceFrequency { - Minute, - Hour, - Day, - Week, - Month, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RecurrenceFrequency { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RecurrenceFrequency { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RecurrenceFrequency { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Minute => serializer.serialize_unit_variant("RecurrenceFrequency", 0u32, "Minute"), - Self::Hour => serializer.serialize_unit_variant("RecurrenceFrequency", 1u32, "Hour"), - Self::Day => serializer.serialize_unit_variant("RecurrenceFrequency", 2u32, "Day"), - Self::Week => serializer.serialize_unit_variant("RecurrenceFrequency", 3u32, "Week"), - Self::Month => serializer.serialize_unit_variant("RecurrenceFrequency", 4u32, "Month"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RecurrenceSchedule { - #[doc = "[Required] List of hours for the schedule."] - pub hours: Vec, - #[doc = "[Required] List of minutes for the schedule."] - pub minutes: Vec, - #[doc = "List of month days for the schedule"] - #[serde( - rename = "monthDays", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub month_days: Vec, - #[doc = "List of days for the schedule."] - #[serde( - rename = "weekDays", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub week_days: Vec, -} -impl RecurrenceSchedule { - pub fn new(hours: Vec, minutes: Vec) -> Self { - Self { - hours, - minutes, - month_days: Vec::new(), - week_days: Vec::new(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RecurrenceTrigger { - #[serde(flatten)] - pub trigger_base: TriggerBase, - #[doc = "Enum to describe the frequency of a recurrence schedule"] - pub frequency: RecurrenceFrequency, - #[doc = "[Required] Specifies schedule interval in conjunction with frequency"] - pub interval: i32, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl RecurrenceTrigger { - pub fn new(trigger_base: TriggerBase, frequency: RecurrenceFrequency, interval: i32) -> Self { - Self { - trigger_base, - frequency, - interval, - schedule: None, - } - } -} -#[doc = "Enum to determine which reference method to use for an asset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ReferenceType")] -pub enum ReferenceType { - Id, - DataPath, - OutputPath, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ReferenceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ReferenceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ReferenceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Id => serializer.serialize_unit_variant("ReferenceType", 0u32, "Id"), - Self::DataPath => serializer.serialize_unit_variant("ReferenceType", 1u32, "DataPath"), - Self::OutputPath => serializer.serialize_unit_variant("ReferenceType", 2u32, "OutputPath"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegenerateEndpointKeysRequest { - #[serde(rename = "keyType")] - pub key_type: KeyType, - #[doc = "The value the key is set to."] - #[serde(rename = "keyValue", default, skip_serializing_if = "Option::is_none")] - pub key_value: Option, -} -impl RegenerateEndpointKeysRequest { - pub fn new(key_type: KeyType) -> Self { - Self { key_type, key_value: None } - } -} -#[doc = "Details of the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Registry { - #[doc = "Discovery URL for the Registry"] - #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] - pub discovery_url: Option, - #[doc = "IntellectualPropertyPublisher for the registry"] - #[serde(rename = "intellectualPropertyPublisher", default, skip_serializing_if = "Option::is_none")] - pub intellectual_property_publisher: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "managedResourceGroup", default, skip_serializing_if = "Option::is_none")] - pub managed_resource_group: Option, - #[doc = "MLFlow Registry URI for the Registry"] - #[serde(rename = "mlFlowRegistryUri", default, skip_serializing_if = "Option::is_none")] - pub ml_flow_registry_uri: Option, - #[doc = "Private endpoint connections info used for pending connections in private link portal"] - #[serde( - rename = "privateEndpointConnections", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub private_endpoint_connections: Vec, - #[doc = "Is the Registry accessible from the internet?\r\nPossible values: \"Enabled\" or \"Disabled\""] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "Details of each region the registry is in"] - #[serde( - rename = "regionDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub region_details: Vec, -} -impl Registry { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryListCredentialsResult { - #[doc = "The location of the workspace ACR"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub passwords: Vec, - #[doc = "The username of the workspace ACR"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, -} -impl RegistryListCredentialsResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Managed service identity (system assigned and/or user assigned identities)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegistryPartialManagedServiceIdentity { - #[serde(flatten)] - pub managed_service_identity: ManagedServiceIdentity, -} -impl RegistryPartialManagedServiceIdentity { - pub fn new(managed_service_identity: ManagedServiceIdentity) -> Self { - Self { managed_service_identity } - } -} -#[doc = "Private endpoint connection definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryPrivateEndpointConnection { - #[doc = "This is the private endpoint connection name created on SRP\r\nFull resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Same as workspace location."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Properties of the Private Endpoint Connection"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl RegistryPrivateEndpointConnection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of the Private Endpoint Connection"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryPrivateEndpointConnectionProperties { - #[doc = "The group ids"] - #[serde( - rename = "groupIds", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub group_ids: Vec, - #[doc = "The PE network resource that is linked to this PE connection."] - #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] - pub private_endpoint: Option, - #[doc = "The connection state."] - #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] - pub private_link_service_connection_state: Option, - #[doc = "One of null, \"Succeeded\", \"Provisioning\", \"Failed\". While not approved, it's null."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl RegistryPrivateEndpointConnectionProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The connection state."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryPrivateLinkServiceConnectionState { - #[doc = "Some RP chose \"None\". Other RPs use this for region expansion."] - #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] - pub actions_required: Option, - #[doc = "User-defined message that, per NRP doc, may be used for approval-related message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Connection status of the service consumer with the service provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl RegistryPrivateLinkServiceConnectionState { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Details for each region the registry is in"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryRegionArmDetails { - #[doc = "List of ACR accounts"] - #[serde( - rename = "acrDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub acr_details: Vec, - #[doc = "The location where the registry exists"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "List of storage accounts"] - #[serde( - rename = "storageAccountDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub storage_account_details: Vec, -} -impl RegistryRegionArmDetails { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegistryTrackedResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Details of the Registry"] - pub properties: Registry, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl RegistryTrackedResource { - pub fn new(tracked_resource: TrackedResource, properties: Registry) -> Self { - Self { - tracked_resource, - identity: None, - kind: None, - properties, - sku: None, - } - } -} -#[doc = "A paginated list of Registry entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegistryTrackedResourceArmPaginatedResult { - #[doc = "The link to the next page of Registry objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Registry."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for RegistryTrackedResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl RegistryTrackedResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Regression task in AutoML Table vertical."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Regression { - #[serde(flatten)] - pub table_vertical: TableVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for Regression task."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, - #[doc = "Regression Training related configuration."] - #[serde(rename = "trainingSettings", default, skip_serializing_if = "Option::is_none")] - pub training_settings: Option, -} -impl Regression { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - table_vertical: TableVertical::default(), - auto_ml_vertical, - primary_metric: None, - training_settings: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionModelPerformanceMetric")] -pub enum RegressionModelPerformanceMetric { - MeanAbsoluteError, - RootMeanSquaredError, - MeanSquaredError, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RegressionModelPerformanceMetric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RegressionModelPerformanceMetric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RegressionModelPerformanceMetric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MeanAbsoluteError => serializer.serialize_unit_variant("RegressionModelPerformanceMetric", 0u32, "MeanAbsoluteError"), - Self::RootMeanSquaredError => { - serializer.serialize_unit_variant("RegressionModelPerformanceMetric", 1u32, "RootMeanSquaredError") - } - Self::MeanSquaredError => serializer.serialize_unit_variant("RegressionModelPerformanceMetric", 2u32, "MeanSquaredError"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegressionModelPerformanceMetricThreshold { - #[serde(flatten)] - pub model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - pub metric: RegressionModelPerformanceMetric, -} -impl RegressionModelPerformanceMetricThreshold { - pub fn new( - model_performance_metric_threshold_base: ModelPerformanceMetricThresholdBase, - metric: RegressionModelPerformanceMetric, - ) -> Self { - Self { - model_performance_metric_threshold_base, - metric, - } - } -} -#[doc = "Enum for all Regression models supported by AutoML."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionModels")] -pub enum RegressionModels { - ElasticNet, - GradientBoosting, - DecisionTree, - #[serde(rename = "KNN")] - Knn, - LassoLars, - #[serde(rename = "SGD")] - Sgd, - RandomForest, - ExtremeRandomTrees, - #[serde(rename = "LightGBM")] - LightGbm, - #[serde(rename = "XGBoostRegressor")] - XgBoostRegressor, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RegressionModels { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RegressionModels { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RegressionModels { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ElasticNet => serializer.serialize_unit_variant("RegressionModels", 0u32, "ElasticNet"), - Self::GradientBoosting => serializer.serialize_unit_variant("RegressionModels", 1u32, "GradientBoosting"), - Self::DecisionTree => serializer.serialize_unit_variant("RegressionModels", 2u32, "DecisionTree"), - Self::Knn => serializer.serialize_unit_variant("RegressionModels", 3u32, "KNN"), - Self::LassoLars => serializer.serialize_unit_variant("RegressionModels", 4u32, "LassoLars"), - Self::Sgd => serializer.serialize_unit_variant("RegressionModels", 5u32, "SGD"), - Self::RandomForest => serializer.serialize_unit_variant("RegressionModels", 6u32, "RandomForest"), - Self::ExtremeRandomTrees => serializer.serialize_unit_variant("RegressionModels", 7u32, "ExtremeRandomTrees"), - Self::LightGbm => serializer.serialize_unit_variant("RegressionModels", 8u32, "LightGBM"), - Self::XgBoostRegressor => serializer.serialize_unit_variant("RegressionModels", 9u32, "XGBoostRegressor"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Primary metrics for Regression task."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RegressionPrimaryMetrics")] -pub enum RegressionPrimaryMetrics { - SpearmanCorrelation, - NormalizedRootMeanSquaredError, - R2Score, - NormalizedMeanAbsoluteError, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RegressionPrimaryMetrics { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RegressionPrimaryMetrics { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RegressionPrimaryMetrics { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SpearmanCorrelation => serializer.serialize_unit_variant("RegressionPrimaryMetrics", 0u32, "SpearmanCorrelation"), - Self::NormalizedRootMeanSquaredError => { - serializer.serialize_unit_variant("RegressionPrimaryMetrics", 1u32, "NormalizedRootMeanSquaredError") - } - Self::R2Score => serializer.serialize_unit_variant("RegressionPrimaryMetrics", 2u32, "R2Score"), - Self::NormalizedMeanAbsoluteError => { - serializer.serialize_unit_variant("RegressionPrimaryMetrics", 3u32, "NormalizedMeanAbsoluteError") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Regression Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RegressionTrainingSettings { - #[serde(flatten)] - pub training_settings: TrainingSettings, - #[doc = "Allowed models for regression task."] - #[serde( - rename = "allowedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub allowed_training_algorithms: Vec, - #[doc = "Blocked models for regression task."] - #[serde( - rename = "blockedTrainingAlgorithms", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_training_algorithms: Vec, -} -impl RegressionTrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RequestLogging { - #[doc = "For payload logging, we only collect payload by default. If customers also want to collect the specified headers, they can set them in captureHeaders so that backend will collect those headers along with payload."] - #[serde( - rename = "captureHeaders", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub capture_headers: Vec, -} -impl RequestLogging { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceBase { - #[doc = "The asset description text."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The asset property dictionary."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Tag dictionary. Tags can be added, removed, and updated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl ResourceBase { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceConfiguration { - #[doc = "Optional number of instances or nodes used by the compute target."] - #[serde(rename = "instanceCount", default, skip_serializing_if = "Option::is_none")] - pub instance_count: Option, - #[doc = "Optional type of VM used as supported by the compute target."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Locations where the job can run."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub locations: Vec, - #[doc = "Optional max allowed number of instances or nodes to be used by the compute target.\r\nFor use with elastic training, currently supported by PyTorch distribution type only."] - #[serde(rename = "maxInstanceCount", default, skip_serializing_if = "Option::is_none")] - pub max_instance_count: Option, - #[doc = "Additional properties bag."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ResourceId { - #[doc = "The ID of the resource"] - pub id: String, -} -impl ResourceId { - pub fn new(id: String) -> Self { - Self { id } - } -} -#[doc = "The Resource Name."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceName { - #[doc = "The name of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The localized name of the resource."] - #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] - pub localized_value: Option, -} -impl ResourceName { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The quota assigned to a resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceQuota { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Region of the AML workspace in the id."] - #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] - pub aml_workspace_location: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The Resource Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The maximum permitted quota of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "An enum describing the unit of quota measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, -} -impl ResourceQuota { - pub fn new() -> Self { - Self::default() - } -} -pub mod resource_quota { - use super::*; - #[doc = "An enum describing the unit of quota measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RollingRateType")] -pub enum RollingRateType { - Year, - Month, - Day, - Hour, - Minute, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RollingRateType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RollingRateType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RollingRateType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Year => serializer.serialize_unit_variant("RollingRateType", 0u32, "Year"), - Self::Month => serializer.serialize_unit_variant("RollingRateType", 1u32, "Month"), - Self::Day => serializer.serialize_unit_variant("RollingRateType", 2u32, "Day"), - Self::Hour => serializer.serialize_unit_variant("RollingRateType", 3u32, "Hour"), - Self::Minute => serializer.serialize_unit_variant("RollingRateType", 4u32, "Minute"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Route { - #[doc = "[Required] The path for the route."] - pub path: String, - #[doc = "[Required] The port for the route."] - pub port: i32, -} -impl Route { - pub fn new(path: String, port: i32) -> Self { - Self { path, port } - } -} -#[doc = "The action enum for networking rule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleAction")] -pub enum RuleAction { - Allow, - Deny, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleAction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleAction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleAction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Allow => serializer.serialize_unit_variant("RuleAction", 0u32, "Allow"), - Self::Deny => serializer.serialize_unit_variant("RuleAction", 1u32, "Deny"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Category of a managed network Outbound Rule of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleCategory")] -pub enum RuleCategory { - Required, - Recommended, - UserDefined, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleCategory { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleCategory { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleCategory { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Required => serializer.serialize_unit_variant("RuleCategory", 0u32, "Required"), - Self::Recommended => serializer.serialize_unit_variant("RuleCategory", 1u32, "Recommended"), - Self::UserDefined => serializer.serialize_unit_variant("RuleCategory", 2u32, "UserDefined"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Type of a managed network Outbound Rule of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleStatus")] -pub enum RuleStatus { - Inactive, - Active, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Inactive => serializer.serialize_unit_variant("RuleStatus", 0u32, "Inactive"), - Self::Active => serializer.serialize_unit_variant("RuleStatus", 1u32, "Active"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Type of a managed network Outbound Rule of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleType")] -pub enum RuleType { - #[serde(rename = "FQDN")] - Fqdn, - PrivateEndpoint, - ServiceTag, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Fqdn => serializer.serialize_unit_variant("RuleType", 0u32, "FQDN"), - Self::PrivateEndpoint => serializer.serialize_unit_variant("RuleType", 1u32, "PrivateEndpoint"), - Self::ServiceTag => serializer.serialize_unit_variant("RuleType", 2u32, "ServiceTag"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl SasAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasCredentialDto { - #[serde(flatten)] - pub pending_upload_credential_dto: PendingUploadCredentialDto, - #[doc = "Full SAS Uri, including the storage, container/blob path and SAS token"] - #[serde(rename = "sasUri", default, skip_serializing_if = "Option::is_none")] - pub sas_uri: Option, -} -impl SasCredentialDto { - pub fn new(pending_upload_credential_dto: PendingUploadCredentialDto) -> Self { - Self { - pending_upload_credential_dto, - sas_uri: None, - } - } -} -#[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamplingAlgorithm { - #[serde(rename = "samplingAlgorithmType")] - pub sampling_algorithm_type: SamplingAlgorithmType, -} -impl SamplingAlgorithm { - pub fn new(sampling_algorithm_type: SamplingAlgorithmType) -> Self { - Self { sampling_algorithm_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "samplingAlgorithmType")] -pub enum SamplingAlgorithmUnion { - Bayesian(BayesianSamplingAlgorithm), - Grid(GridSamplingAlgorithm), - Random(RandomSamplingAlgorithm), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SamplingAlgorithmType")] -pub enum SamplingAlgorithmType { - Grid, - Random, - Bayesian, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SamplingAlgorithmType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SamplingAlgorithmType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SamplingAlgorithmType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Grid => serializer.serialize_unit_variant("SamplingAlgorithmType", 0u32, "Grid"), - Self::Random => serializer.serialize_unit_variant("SamplingAlgorithmType", 1u32, "Random"), - Self::Bayesian => serializer.serialize_unit_variant("SamplingAlgorithmType", 2u32, "Bayesian"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "SAS datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Datastore SAS secrets."] - pub secrets: SasDatastoreSecrets, -} -impl SasDatastoreCredentials { - pub fn new(datastore_credentials: DatastoreCredentials, secrets: SasDatastoreSecrets) -> Self { - Self { - datastore_credentials, - secrets, - } - } -} -#[doc = "Datastore SAS secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SasDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Storage container SAS token."] - #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] - pub sas_token: Option, -} -impl SasDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - sas_token: None, - } - } -} -#[doc = "scale settings for AML Compute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScaleSettings { - #[doc = "Max number of nodes to use"] - #[serde(rename = "maxNodeCount")] - pub max_node_count: i32, - #[doc = "Min number of nodes to use"] - #[serde(rename = "minNodeCount", default, skip_serializing_if = "Option::is_none")] - pub min_node_count: Option, - #[doc = "Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format."] - #[serde(rename = "nodeIdleTimeBeforeScaleDown", default, skip_serializing_if = "Option::is_none")] - pub node_idle_time_before_scale_down: Option, -} -impl ScaleSettings { - pub fn new(max_node_count: i32) -> Self { - Self { - max_node_count, - min_node_count: None, - node_idle_time_before_scale_down: None, - } - } -} -#[doc = "Desired scale settings for the amlCompute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScaleSettingsInformation { - #[doc = "scale settings for AML Compute"] - #[serde(rename = "scaleSettings", default, skip_serializing_if = "Option::is_none")] - pub scale_settings: Option, -} -impl ScaleSettingsInformation { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScaleType")] -pub enum ScaleType { - Default, - TargetUtilization, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScaleType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScaleType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScaleType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("ScaleType", 0u32, "Default"), - Self::TargetUtilization => serializer.serialize_unit_variant("ScaleType", 1u32, "TargetUtilization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Base definition of a schedule"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Schedule { - #[serde(flatten)] - pub resource_base: ResourceBase, - pub action: ScheduleActionBaseUnion, - #[doc = "Display name of schedule."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Is the schedule enabled?"] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option, - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - pub trigger: TriggerBaseUnion, -} -impl Schedule { - pub fn new(action: ScheduleActionBaseUnion, trigger: TriggerBaseUnion) -> Self { - Self { - resource_base: ResourceBase::default(), - action, - display_name: None, - is_enabled: None, - provisioning_state: None, - trigger, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduleActionBase { - #[serde(rename = "actionType")] - pub action_type: ScheduleActionType, -} -impl ScheduleActionBase { - pub fn new(action_type: ScheduleActionType) -> Self { - Self { action_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "actionType")] -pub enum ScheduleActionBaseUnion { - CreateMonitor(CreateMonitorAction), - InvokeBatchEndpoint(EndpointScheduleAction), - ImportData(ImportDataAction), - CreateJob(JobScheduleAction), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleActionType")] -pub enum ScheduleActionType { - CreateJob, - InvokeBatchEndpoint, - ImportData, - CreateMonitor, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleActionType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleActionType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleActionType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CreateJob => serializer.serialize_unit_variant("ScheduleActionType", 0u32, "CreateJob"), - Self::InvokeBatchEndpoint => serializer.serialize_unit_variant("ScheduleActionType", 1u32, "InvokeBatchEndpoint"), - Self::ImportData => serializer.serialize_unit_variant("ScheduleActionType", 2u32, "ImportData"), - Self::CreateMonitor => serializer.serialize_unit_variant("ScheduleActionType", 3u32, "CreateMonitor"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScheduleBase { - #[doc = "A system assigned id for the schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The current deployment state of schedule."] - #[serde(rename = "provisioningStatus", default, skip_serializing_if = "Option::is_none")] - pub provisioning_status: Option, - #[doc = "Is the schedule enabled or disabled?"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl ScheduleBase { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleListViewType")] -pub enum ScheduleListViewType { - EnabledOnly, - DisabledOnly, - All, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleListViewType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleListViewType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleListViewType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::EnabledOnly => serializer.serialize_unit_variant("ScheduleListViewType", 0u32, "EnabledOnly"), - Self::DisabledOnly => serializer.serialize_unit_variant("ScheduleListViewType", 1u32, "DisabledOnly"), - Self::All => serializer.serialize_unit_variant("ScheduleListViewType", 2u32, "All"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The current deployment state of schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleProvisioningState")] -pub enum ScheduleProvisioningState { - Completed, - Provisioning, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Completed => serializer.serialize_unit_variant("ScheduleProvisioningState", 0u32, "Completed"), - Self::Provisioning => serializer.serialize_unit_variant("ScheduleProvisioningState", 1u32, "Provisioning"), - Self::Failed => serializer.serialize_unit_variant("ScheduleProvisioningState", 2u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleProvisioningStatus")] -pub enum ScheduleProvisioningStatus { - Creating, - Updating, - Deleting, - Succeeded, - Failed, - Canceled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleProvisioningStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleProvisioningStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleProvisioningStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Creating => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 0u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 1u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 2u32, "Deleting"), - Self::Succeeded => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 3u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 4u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ScheduleProvisioningStatus", 5u32, "Canceled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Azure Resource Manager resource envelope."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduleResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Base definition of a schedule"] - pub properties: Schedule, -} -impl ScheduleResource { - pub fn new(properties: Schedule) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[doc = "A paginated list of Schedule entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScheduleResourceArmPaginatedResult { - #[doc = "The link to the next page of Schedule objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type Schedule."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ScheduleResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl ScheduleResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Is the schedule enabled or disabled?"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScheduleStatus")] -pub enum ScheduleStatus { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScheduleStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScheduleStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScheduleStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("ScheduleStatus", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("ScheduleStatus", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Script reference"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScriptReference { - #[doc = "The storage source of the script: inline, workspace."] - #[serde(rename = "scriptSource", default, skip_serializing_if = "Option::is_none")] - pub script_source: Option, - #[doc = "The location of scripts in the mounted volume."] - #[serde(rename = "scriptData", default, skip_serializing_if = "Option::is_none")] - pub script_data: Option, - #[doc = "Optional command line arguments passed to the script to run."] - #[serde(rename = "scriptArguments", default, skip_serializing_if = "Option::is_none")] - pub script_arguments: Option, - #[doc = "Optional time period passed to timeout command."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, -} -impl ScriptReference { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Customized setup scripts"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScriptsToExecute { - #[doc = "Script reference"] - #[serde(rename = "startupScript", default, skip_serializing_if = "Option::is_none")] - pub startup_script: Option, - #[doc = "Script reference"] - #[serde(rename = "creationScript", default, skip_serializing_if = "Option::is_none")] - pub creation_script: Option, -} -impl ScriptsToExecute { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Forecasting seasonality."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Seasonality { - #[doc = "Forecasting seasonality mode."] - pub mode: SeasonalityMode, -} -impl Seasonality { - pub fn new(mode: SeasonalityMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum SeasonalityUnion { - Auto(AutoSeasonality), - Custom(CustomSeasonality), -} -#[doc = "Forecasting seasonality mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SeasonalityMode")] -pub enum SeasonalityMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SeasonalityMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SeasonalityMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SeasonalityMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("SeasonalityMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("SeasonalityMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Secret Configuration definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecretConfiguration { - #[doc = "Secret Uri.\r\nSample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option, - #[doc = "Name of secret in workspace key vault."] - #[serde(rename = "workspaceSecretName", default, skip_serializing_if = "Option::is_none")] - pub workspace_secret_name: Option, -} -impl SecretConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Enum to determine the datastore secrets type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SecretsType")] -pub enum SecretsType { - AccountKey, - Certificate, - Sas, - ServicePrincipal, - KerberosPassword, - KerberosKeytab, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SecretsType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SecretsType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SecretsType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AccountKey => serializer.serialize_unit_variant("SecretsType", 0u32, "AccountKey"), - Self::Certificate => serializer.serialize_unit_variant("SecretsType", 1u32, "Certificate"), - Self::Sas => serializer.serialize_unit_variant("SecretsType", 2u32, "Sas"), - Self::ServicePrincipal => serializer.serialize_unit_variant("SecretsType", 3u32, "ServicePrincipal"), - Self::KerberosPassword => serializer.serialize_unit_variant("SecretsType", 4u32, "KerberosPassword"), - Self::KerberosKeytab => serializer.serialize_unit_variant("SecretsType", 5u32, "KerberosKeytab"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ServiceDataAccessAuthIdentity")] -pub enum ServiceDataAccessAuthIdentity { - None, - WorkspaceSystemAssignedIdentity, - WorkspaceUserAssignedIdentity, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ServiceDataAccessAuthIdentity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ServiceDataAccessAuthIdentity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ServiceDataAccessAuthIdentity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ServiceDataAccessAuthIdentity", 0u32, "None"), - Self::WorkspaceSystemAssignedIdentity => { - serializer.serialize_unit_variant("ServiceDataAccessAuthIdentity", 1u32, "WorkspaceSystemAssignedIdentity") - } - Self::WorkspaceUserAssignedIdentity => { - serializer.serialize_unit_variant("ServiceDataAccessAuthIdentity", 2u32, "WorkspaceUserAssignedIdentity") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServiceManagedResourcesSettings { - #[serde(rename = "cosmosDb", default, skip_serializing_if = "Option::is_none")] - pub cosmos_db: Option, -} -impl ServiceManagedResourcesSettings { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl ServicePrincipalAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Service Principal datastore credentials configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalDatastoreCredentials { - #[serde(flatten)] - pub datastore_credentials: DatastoreCredentials, - #[doc = "Authority URL used for authentication."] - #[serde(rename = "authorityUrl", default, skip_serializing_if = "Option::is_none")] - pub authority_url: Option, - #[doc = "[Required] Service principal client ID."] - #[serde(rename = "clientId")] - pub client_id: String, - #[doc = "Resource the service principal has access to."] - #[serde(rename = "resourceUrl", default, skip_serializing_if = "Option::is_none")] - pub resource_url: Option, - #[doc = "Datastore Service Principal secrets."] - pub secrets: ServicePrincipalDatastoreSecrets, - #[doc = "[Required] ID of the tenant to which the service principal belongs."] - #[serde(rename = "tenantId")] - pub tenant_id: String, -} -impl ServicePrincipalDatastoreCredentials { - pub fn new( - datastore_credentials: DatastoreCredentials, - client_id: String, - secrets: ServicePrincipalDatastoreSecrets, - tenant_id: String, - ) -> Self { - Self { - datastore_credentials, - authority_url: None, - client_id, - resource_url: None, - secrets, - tenant_id, - } - } -} -#[doc = "Datastore Service Principal secrets."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServicePrincipalDatastoreSecrets { - #[serde(flatten)] - pub datastore_secrets: DatastoreSecrets, - #[doc = "Service principal secret."] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, -} -impl ServicePrincipalDatastoreSecrets { - pub fn new(datastore_secrets: DatastoreSecrets) -> Self { - Self { - datastore_secrets, - client_secret: None, - } - } -} -#[doc = "Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServiceTagDestination { - #[doc = "The action enum for networking rule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option, - #[doc = "Optional, if provided, the ServiceTag property will be ignored."] - #[serde( - rename = "addressPrefixes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub address_prefixes: Vec, - #[serde(rename = "portRanges", default, skip_serializing_if = "Option::is_none")] - pub port_ranges: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "serviceTag", default, skip_serializing_if = "Option::is_none")] - pub service_tag: Option, -} -impl ServiceTagDestination { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Service Tag Outbound Rule for the managed network of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceTagOutboundRule { - #[serde(flatten)] - pub outbound_rule: OutboundRule, - #[doc = "Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub destination: Option, -} -impl ServiceTagOutboundRule { - pub fn new(outbound_rule: OutboundRule) -> Self { - Self { - outbound_rule, - destination: None, - } - } -} -#[doc = "Details of customized scripts to execute for setting up the cluster."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SetupScripts { - #[doc = "Customized setup scripts"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scripts: Option, -} -impl SetupScripts { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SharedPrivateLinkResource { - #[doc = "Unique name of the private link"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Properties of a shared private link resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SharedPrivateLinkResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of a shared private link resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SharedPrivateLinkResourceProperty { - #[doc = "group id of the private link"] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option, - #[doc = "the resource id that private link links to"] - #[serde(rename = "privateLinkResourceId", default, skip_serializing_if = "Option::is_none")] - pub private_link_resource_id: Option, - #[doc = "Request message"] - #[serde(rename = "requestMessage", default, skip_serializing_if = "Option::is_none")] - pub request_message: Option, - #[doc = "Connection status of the service consumer with the service provider\r\nPossible state transitions\r\nPending -> Approved (Service provider approves the connection request)\r\nPending -> Rejected (Service provider rejects the connection request)\r\nPending -> Disconnected (Service provider deletes the connection)\r\nApproved -> Rejected (Service provider rejects the approved connection)\r\nApproved -> Disconnected (Service provider deletes the connection)\r\nRejected -> Pending (Service consumer re-initiates the connection request that was rejected)\r\nRejected -> Disconnected (Service provider deletes the connection)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl SharedPrivateLinkResourceProperty { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The parameter defining how if AutoML should handle short time series."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ShortSeriesHandlingConfiguration")] -pub enum ShortSeriesHandlingConfiguration { - None, - Auto, - Pad, - Drop, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ShortSeriesHandlingConfiguration { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ShortSeriesHandlingConfiguration { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ShortSeriesHandlingConfiguration { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 0u32, "None"), - Self::Auto => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 1u32, "Auto"), - Self::Pad => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 2u32, "Pad"), - Self::Drop => serializer.serialize_unit_variant("ShortSeriesHandlingConfiguration", 3u32, "Drop"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The resource model definition representing SKU"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Sku { - #[doc = "The name of the SKU. Ex - P3. It is typically a letter+number code"] - pub name: String, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, - #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. "] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, - #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, -} -impl Sku { - pub fn new(name: String) -> Self { - Self { - name, - tier: None, - size: None, - family: None, - capacity: None, - } - } -} -#[doc = "SKU capacity information"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SkuCapacity { - #[doc = "Gets or sets the default capacity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub default: Option, - #[doc = "Gets or sets the maximum."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub maximum: Option, - #[doc = "Gets or sets the minimum."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub minimum: Option, - #[doc = "Node scaling setting for the compute sku."] - #[serde(rename = "scaleType", default, skip_serializing_if = "Option::is_none")] - pub scale_type: Option, -} -impl SkuCapacity { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Fulfills ARM Contract requirement to list all available SKUS for a resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SkuResource { - #[doc = "SKU capacity information"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, - #[doc = "The resource type name."] - #[serde(rename = "resourceType", default, skip_serializing_if = "Option::is_none")] - pub resource_type: Option, - #[doc = "SkuSetting fulfills the need for stripped down SKU info in ARM contract."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl SkuResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A paginated list of SkuResource entities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SkuResourceArmPaginatedResult { - #[doc = "The link to the next page of SkuResource objects. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "An array of objects of type SkuResource."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for SkuResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl SkuResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Node scaling setting for the compute sku."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SkuScaleType")] -pub enum SkuScaleType { - Automatic, - Manual, - None, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SkuScaleType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SkuScaleType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SkuScaleType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Automatic => serializer.serialize_unit_variant("SkuScaleType", 0u32, "Automatic"), - Self::Manual => serializer.serialize_unit_variant("SkuScaleType", 1u32, "Manual"), - Self::None => serializer.serialize_unit_variant("SkuScaleType", 2u32, "None"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "SkuSetting fulfills the need for stripped down SKU info in ARM contract."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SkuSetting { - #[doc = "[Required] The name of the SKU. Ex - P3. It is typically a letter+number code."] - pub name: String, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, -} -impl SkuSetting { - pub fn new(name: String) -> Self { - Self { name, tier: None } - } -} -#[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum SkuTier { - Free, - Basic, - Standard, - Premium, -} -#[doc = "Spark job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Archive files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub archives: Vec, - #[doc = "Arguments for the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub args: Option, - #[doc = "[Required] ARM resource ID of the code asset."] - #[serde(rename = "codeId")] - pub code_id: String, - #[doc = "Spark configured properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub conf: Option, - #[doc = "Spark job entry point definition."] - pub entry: SparkJobEntryUnion, - #[doc = "The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId", default, skip_serializing_if = "Option::is_none")] - pub environment_id: Option, - #[doc = "Files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub files: Vec, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Jar files used in the job."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub jars: Vec, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[doc = "Python files used in the job."] - #[serde( - rename = "pyFiles", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub py_files: Vec, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl SparkJob { - pub fn new(job_base: JobBase, code_id: String, entry: SparkJobEntryUnion) -> Self { - Self { - job_base, - archives: Vec::new(), - args: None, - code_id, - conf: None, - entry, - environment_id: None, - files: Vec::new(), - inputs: None, - jars: Vec::new(), - outputs: None, - py_files: Vec::new(), - queue_settings: None, - resources: None, - } - } -} -#[doc = "Spark job entry point definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobEntry { - #[serde(rename = "sparkJobEntryType")] - pub spark_job_entry_type: SparkJobEntryType, -} -impl SparkJobEntry { - pub fn new(spark_job_entry_type: SparkJobEntryType) -> Self { - Self { spark_job_entry_type } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "sparkJobEntryType")] -pub enum SparkJobEntryUnion { - SparkJobPythonEntry(SparkJobPythonEntry), - SparkJobScalaEntry(SparkJobScalaEntry), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SparkJobEntryType")] -pub enum SparkJobEntryType { - SparkJobPythonEntry, - SparkJobScalaEntry, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SparkJobEntryType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SparkJobEntryType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SparkJobEntryType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SparkJobPythonEntry => serializer.serialize_unit_variant("SparkJobEntryType", 0u32, "SparkJobPythonEntry"), - Self::SparkJobScalaEntry => serializer.serialize_unit_variant("SparkJobEntryType", 1u32, "SparkJobScalaEntry"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobPythonEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Relative python file path for job entry point."] - pub file: String, -} -impl SparkJobPythonEntry { - pub fn new(spark_job_entry: SparkJobEntry, file: String) -> Self { - Self { spark_job_entry, file } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SparkJobScalaEntry { - #[serde(flatten)] - pub spark_job_entry: SparkJobEntry, - #[doc = "[Required] Scala class name used as entry point."] - #[serde(rename = "className")] - pub class_name: String, -} -impl SparkJobScalaEntry { - pub fn new(spark_job_entry: SparkJobEntry, class_name: String) -> Self { - Self { - spark_job_entry, - class_name, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SparkResourceConfiguration { - #[doc = "Optional type of VM used as supported by the compute target."] - #[serde(rename = "instanceType", default, skip_serializing_if = "Option::is_none")] - pub instance_type: Option, - #[doc = "Version of spark runtime used for the job."] - #[serde(rename = "runtimeVersion", default, skip_serializing_if = "Option::is_none")] - pub runtime_version: Option, -} -impl SparkResourceConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The ssl configuration for scoring"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SslConfiguration { - #[doc = "Enable or disable ssl for scoring"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Cert data"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cert: Option, - #[doc = "Key data"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option, - #[doc = "CNAME of the cert"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cname: Option, - #[doc = "Leaf domain label of public endpoint"] - #[serde(rename = "leafDomainLabel", default, skip_serializing_if = "Option::is_none")] - pub leaf_domain_label: Option, - #[doc = "Indicates whether to overwrite existing domain label."] - #[serde(rename = "overwriteExistingDomain", default, skip_serializing_if = "Option::is_none")] - pub overwrite_existing_domain: Option, -} -impl SslConfiguration { - pub fn new() -> Self { - Self::default() - } -} -pub mod ssl_configuration { - use super::*; - #[doc = "Enable or disable ssl for scoring"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Disabled, - Enabled, - Auto, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("Status", 0u32, "Disabled"), - Self::Enabled => serializer.serialize_unit_variant("Status", 1u32, "Enabled"), - Self::Auto => serializer.serialize_unit_variant("Status", 2u32, "Auto"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Advances setting to customize StackEnsemble run."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StackEnsembleSettings { - #[doc = "Optional parameters to pass to the initializer of the meta-learner."] - #[serde(rename = "stackMetaLearnerKWargs", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_k_wargs: Option, - #[doc = "Specifies the proportion of the training set (when choosing train and validation type of training) to be reserved for training the meta-learner. Default value is 0.2."] - #[serde(rename = "stackMetaLearnerTrainPercentage", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_train_percentage: Option, - #[doc = "The meta-learner is a model trained on the output of the individual heterogeneous models.\r\nDefault meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled).\r\nThis parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression"] - #[serde(rename = "stackMetaLearnerType", default, skip_serializing_if = "Option::is_none")] - pub stack_meta_learner_type: Option, -} -impl StackEnsembleSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The meta-learner is a model trained on the output of the individual heterogeneous models.\r\nDefault meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled).\r\nThis parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StackMetaLearnerType")] -pub enum StackMetaLearnerType { - None, - LogisticRegression, - #[serde(rename = "LogisticRegressionCV")] - LogisticRegressionCv, - #[serde(rename = "LightGBMClassifier")] - LightGbmClassifier, - ElasticNet, - #[serde(rename = "ElasticNetCV")] - ElasticNetCv, - #[serde(rename = "LightGBMRegressor")] - LightGbmRegressor, - LinearRegression, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StackMetaLearnerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StackMetaLearnerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StackMetaLearnerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("StackMetaLearnerType", 0u32, "None"), - Self::LogisticRegression => serializer.serialize_unit_variant("StackMetaLearnerType", 1u32, "LogisticRegression"), - Self::LogisticRegressionCv => serializer.serialize_unit_variant("StackMetaLearnerType", 2u32, "LogisticRegressionCV"), - Self::LightGbmClassifier => serializer.serialize_unit_variant("StackMetaLearnerType", 3u32, "LightGBMClassifier"), - Self::ElasticNet => serializer.serialize_unit_variant("StackMetaLearnerType", 4u32, "ElasticNet"), - Self::ElasticNetCv => serializer.serialize_unit_variant("StackMetaLearnerType", 5u32, "ElasticNetCV"), - Self::LightGbmRegressor => serializer.serialize_unit_variant("StackMetaLearnerType", 6u32, "LightGBMRegressor"), - Self::LinearRegression => serializer.serialize_unit_variant("StackMetaLearnerType", 7u32, "LinearRegression"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Static input data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct StaticInputData { - #[serde(flatten)] - pub monitoring_input_data_base: MonitoringInputDataBase, - #[doc = "The ARM resource ID of the component resource used to preprocess the data."] - #[serde(rename = "preprocessingComponentId", default, skip_serializing_if = "Option::is_none")] - pub preprocessing_component_id: Option, - #[doc = "[Required] The end date of the data window."] - #[serde(rename = "windowEnd", with = "azure_core::date::rfc3339")] - pub window_end: time::OffsetDateTime, - #[doc = "[Required] The start date of the data window."] - #[serde(rename = "windowStart", with = "azure_core::date::rfc3339")] - pub window_start: time::OffsetDateTime, -} -impl StaticInputData { - pub fn new( - monitoring_input_data_base: MonitoringInputDataBase, - window_end: time::OffsetDateTime, - window_start: time::OffsetDateTime, - ) -> Self { - Self { - monitoring_input_data_base, - preprocessing_component_id: None, - window_end, - window_start, - } - } -} -#[doc = "Active message associated with project"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StatusMessage { - #[doc = "Service-defined message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Time in UTC at which the message was created."] - #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] - pub created_date_time: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "A human-readable representation of the message code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl StatusMessage { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StatusMessageLevel")] -pub enum StatusMessageLevel { - Error, - Information, - Warning, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StatusMessageLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StatusMessageLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StatusMessageLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Error => serializer.serialize_unit_variant("StatusMessageLevel", 0u32, "Error"), - Self::Information => serializer.serialize_unit_variant("StatusMessageLevel", 1u32, "Information"), - Self::Warning => serializer.serialize_unit_variant("StatusMessageLevel", 2u32, "Warning"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Stochastic optimizer for image models."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "StochasticOptimizer")] -pub enum StochasticOptimizer { - None, - Sgd, - Adam, - Adamw, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for StochasticOptimizer { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for StochasticOptimizer { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for StochasticOptimizer { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("StochasticOptimizer", 0u32, "None"), - Self::Sgd => serializer.serialize_unit_variant("StochasticOptimizer", 1u32, "Sgd"), - Self::Adam => serializer.serialize_unit_variant("StochasticOptimizer", 2u32, "Adam"), - Self::Adamw => serializer.serialize_unit_variant("StochasticOptimizer", 3u32, "Adamw"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Details of storage account to be used for the Registry"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StorageAccountDetails { - #[serde(rename = "systemCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub system_created_storage_account: Option, - #[serde(rename = "userCreatedStorageAccount", default, skip_serializing_if = "Option::is_none")] - pub user_created_storage_account: Option, -} -impl StorageAccountDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Sweep job definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SweepJob { - #[serde(flatten)] - pub job_base: JobBase, - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[doc = "Mapping of input data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option, - #[doc = "Sweep Job limit class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, - #[doc = "Optimization objective."] - pub objective: Objective, - #[doc = "Mapping of output data bindings used in the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outputs: Option, - #[serde(rename = "queueSettings", default, skip_serializing_if = "Option::is_none")] - pub queue_settings: Option, - #[doc = "The Sampling Algorithm used to generate hyperparameter values, along with properties to\r\nconfigure the algorithm"] - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmUnion, - #[doc = "[Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter"] - #[serde(rename = "searchSpace")] - pub search_space: serde_json::Value, - #[doc = "Trial component definition."] - pub trial: TrialComponent, -} -impl SweepJob { - pub fn new( - job_base: JobBase, - objective: Objective, - sampling_algorithm: SamplingAlgorithmUnion, - search_space: serde_json::Value, - trial: TrialComponent, - ) -> Self { - Self { - job_base, - early_termination: None, - inputs: None, - limits: None, - objective, - outputs: None, - queue_settings: None, - sampling_algorithm, - search_space, - trial, - } - } -} -#[doc = "Sweep Job limit class."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SweepJobLimits { - #[serde(flatten)] - pub job_limits: JobLimits, - #[doc = "Sweep Job max concurrent trials."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Sweep Job max total trials."] - #[serde(rename = "maxTotalTrials", default, skip_serializing_if = "Option::is_none")] - pub max_total_trials: Option, - #[doc = "Sweep Job Trial timeout value."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl SweepJobLimits { - pub fn new(job_limits: JobLimits) -> Self { - Self { - job_limits, - max_concurrent_trials: None, - max_total_trials: None, - trial_timeout: None, - } - } -} -#[doc = "A SynapseSpark compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SynapseSpark { - #[serde(flatten)] - pub compute: Compute, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SynapseSpark { - pub fn new(compute: Compute) -> Self { - Self { compute, properties: None } - } -} -pub mod synapse_spark { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Auto scale properties"] - #[serde(rename = "autoScaleProperties", default, skip_serializing_if = "Option::is_none")] - pub auto_scale_properties: Option, - #[doc = "Auto pause properties"] - #[serde(rename = "autoPauseProperties", default, skip_serializing_if = "Option::is_none")] - pub auto_pause_properties: Option, - #[doc = "Spark version."] - #[serde(rename = "sparkVersion", default, skip_serializing_if = "Option::is_none")] - pub spark_version: Option, - #[doc = "The number of compute nodes currently assigned to the compute."] - #[serde(rename = "nodeCount", default, skip_serializing_if = "Option::is_none")] - pub node_count: Option, - #[doc = "Node size."] - #[serde(rename = "nodeSize", default, skip_serializing_if = "Option::is_none")] - pub node_size: Option, - #[doc = "Node size family."] - #[serde(rename = "nodeSizeFamily", default, skip_serializing_if = "Option::is_none")] - pub node_size_family: Option, - #[doc = "Azure subscription identifier."] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, - #[doc = "Name of the resource group in which workspace is located."] - #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] - pub resource_group: Option, - #[doc = "Name of Azure Machine Learning workspace."] - #[serde(rename = "workspaceName", default, skip_serializing_if = "Option::is_none")] - pub workspace_name: Option, - #[doc = "Pool name."] - #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] - pub pool_name: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedAcrAccount { - #[doc = "Name of the ACR account"] - #[serde(rename = "acrAccountName", default, skip_serializing_if = "Option::is_none")] - pub acr_account_name: Option, - #[doc = "SKU of the ACR account"] - #[serde(rename = "acrAccountSku", default, skip_serializing_if = "Option::is_none")] - pub acr_account_sku: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl SystemCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemCreatedStorageAccount { - #[doc = "Public blob access allowed"] - #[serde(rename = "allowBlobPublicAccess", default, skip_serializing_if = "Option::is_none")] - pub allow_blob_public_access: Option, - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, - #[doc = "HNS enabled for storage account"] - #[serde(rename = "storageAccountHnsEnabled", default, skip_serializing_if = "Option::is_none")] - pub storage_account_hns_enabled: Option, - #[doc = "Name of the storage account"] - #[serde(rename = "storageAccountName", default, skip_serializing_if = "Option::is_none")] - pub storage_account_name: Option, - #[doc = "Allowed values:\r\n\"Standard_LRS\",\r\n\"Standard_GRS\",\r\n\"Standard_RAGRS\",\r\n\"Standard_ZRS\",\r\n\"Standard_GZRS\",\r\n\"Standard_RAGZRS\",\r\n\"Premium_LRS\",\r\n\"Premium_ZRS\""] - #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] - pub storage_account_type: Option, -} -impl SystemCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A system service running on a compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemService { - #[doc = "The type of this system service."] - #[serde(rename = "systemServiceType", default, skip_serializing_if = "Option::is_none")] - pub system_service_type: Option, - #[doc = "Public IP address"] - #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] - pub public_ip_address: Option, - #[doc = "The version for this type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, -} -impl SystemService { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableFixedParameters { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample."] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableFixedParameters { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableParameterSubspace { - #[doc = "Specify the boosting type, e.g gbdt for XGBoost."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub booster: Option, - #[doc = "Specify the boosting type, e.g gbdt for LightGBM."] - #[serde(rename = "boostingType", default, skip_serializing_if = "Option::is_none")] - pub boosting_type: Option, - #[doc = "Specify the grow policy, which controls the way new nodes are added to the tree."] - #[serde(rename = "growPolicy", default, skip_serializing_if = "Option::is_none")] - pub grow_policy: Option, - #[doc = "The learning rate for the training procedure."] - #[serde(rename = "learningRate", default, skip_serializing_if = "Option::is_none")] - pub learning_rate: Option, - #[doc = "Specify the Maximum number of discrete bins to bucket continuous features ."] - #[serde(rename = "maxBin", default, skip_serializing_if = "Option::is_none")] - pub max_bin: Option, - #[doc = "Specify the max depth to limit the tree depth explicitly."] - #[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")] - pub max_depth: Option, - #[doc = "Specify the max leaves to limit the tree leaves explicitly."] - #[serde(rename = "maxLeaves", default, skip_serializing_if = "Option::is_none")] - pub max_leaves: Option, - #[doc = "The minimum number of data per leaf."] - #[serde(rename = "minDataInLeaf", default, skip_serializing_if = "Option::is_none")] - pub min_data_in_leaf: Option, - #[doc = "Minimum loss reduction required to make a further partition on a leaf node of the tree."] - #[serde(rename = "minSplitGain", default, skip_serializing_if = "Option::is_none")] - pub min_split_gain: Option, - #[doc = "The name of the model to train."] - #[serde(rename = "modelName", default, skip_serializing_if = "Option::is_none")] - pub model_name: Option, - #[doc = "Specify the number of trees (or rounds) in an model."] - #[serde(rename = "nEstimators", default, skip_serializing_if = "Option::is_none")] - pub n_estimators: Option, - #[doc = "Specify the number of leaves."] - #[serde(rename = "numLeaves", default, skip_serializing_if = "Option::is_none")] - pub num_leaves: Option, - #[doc = "The name of the preprocessor to use."] - #[serde(rename = "preprocessorName", default, skip_serializing_if = "Option::is_none")] - pub preprocessor_name: Option, - #[doc = "L1 regularization term on weights."] - #[serde(rename = "regAlpha", default, skip_serializing_if = "Option::is_none")] - pub reg_alpha: Option, - #[doc = "L2 regularization term on weights."] - #[serde(rename = "regLambda", default, skip_serializing_if = "Option::is_none")] - pub reg_lambda: Option, - #[doc = "Subsample ratio of the training instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subsample: Option, - #[doc = "Frequency of subsample"] - #[serde(rename = "subsampleFreq", default, skip_serializing_if = "Option::is_none")] - pub subsample_freq: Option, - #[doc = "Specify the tree method."] - #[serde(rename = "treeMethod", default, skip_serializing_if = "Option::is_none")] - pub tree_method: Option, - #[doc = "If true, center before scaling the data with StandardScalar."] - #[serde(rename = "withMean", default, skip_serializing_if = "Option::is_none")] - pub with_mean: Option, - #[doc = "If true, scaling the data with Unit Variance with StandardScalar."] - #[serde(rename = "withStd", default, skip_serializing_if = "Option::is_none")] - pub with_std: Option, -} -impl TableParameterSubspace { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TableSweepSettings { - #[doc = "Early termination policies enable canceling poor-performing runs before they complete"] - #[serde(rename = "earlyTermination", default, skip_serializing_if = "Option::is_none")] - pub early_termination: Option, - #[serde(rename = "samplingAlgorithm")] - pub sampling_algorithm: SamplingAlgorithmType, -} -impl TableSweepSettings { - pub fn new(sampling_algorithm: SamplingAlgorithmType) -> Self { - Self { - early_termination: None, - sampling_algorithm, - } - } -} -#[doc = "Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVertical { - #[doc = "Columns to use for CVSplit data."] - #[serde( - rename = "cvSplitColumnNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub cv_split_column_names: Vec, - #[doc = "Featurization Configuration."] - #[serde(rename = "featurizationSettings", default, skip_serializing_if = "Option::is_none")] - pub featurization_settings: Option, - #[doc = "Fixed training parameters that won't be swept over during AutoML Table training."] - #[serde(rename = "fixedParameters", default, skip_serializing_if = "Option::is_none")] - pub fixed_parameters: Option, - #[doc = "Job execution constraints."] - #[serde(rename = "limitSettings", default, skip_serializing_if = "Option::is_none")] - pub limit_settings: Option, - #[doc = "N-Cross validations value."] - #[serde(rename = "nCrossValidations", default, skip_serializing_if = "Option::is_none")] - pub n_cross_validations: Option, - #[doc = "Search space for sampling different combinations of models and their hyperparameters."] - #[serde( - rename = "searchSpace", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub search_space: Vec, - #[serde(rename = "sweepSettings", default, skip_serializing_if = "Option::is_none")] - pub sweep_settings: Option, - #[serde(rename = "testData", default, skip_serializing_if = "Option::is_none")] - pub test_data: Option, - #[doc = "The fraction of test dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "testDataSize", default, skip_serializing_if = "Option::is_none")] - pub test_data_size: Option, - #[serde(rename = "validationData", default, skip_serializing_if = "Option::is_none")] - pub validation_data: Option, - #[doc = "The fraction of training dataset that needs to be set aside for validation purpose.\r\nValues between (0.0 , 1.0)\r\nApplied when validation dataset is not provided."] - #[serde(rename = "validationDataSize", default, skip_serializing_if = "Option::is_none")] - pub validation_data_size: Option, - #[doc = "The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down."] - #[serde(rename = "weightColumnName", default, skip_serializing_if = "Option::is_none")] - pub weight_column_name: Option, -} -impl TableVertical { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Featurization Configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVerticalFeaturizationSettings { - #[serde(flatten)] - pub featurization_settings: FeaturizationSettings, - #[doc = "These transformers shall not be used in featurization."] - #[serde( - rename = "blockedTransformers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub blocked_transformers: Vec, - #[doc = "Dictionary of column name and its type (int, float, string, datetime etc)."] - #[serde(rename = "columnNameAndTypes", default, skip_serializing_if = "Option::is_none")] - pub column_name_and_types: Option, - #[doc = "Determines whether to use Dnn based featurizers for data featurization."] - #[serde(rename = "enableDnnFeaturization", default, skip_serializing_if = "Option::is_none")] - pub enable_dnn_featurization: Option, - #[doc = "Featurization mode - determines data featurization mode."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "User can specify additional transformers to be used along with the columns to which it would be applied and parameters for the transformer constructor."] - #[serde(rename = "transformerParams", default, skip_serializing_if = "Option::is_none")] - pub transformer_params: Option, -} -impl TableVerticalFeaturizationSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Job execution constraints."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TableVerticalLimitSettings { - #[doc = "Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations."] - #[serde(rename = "enableEarlyTermination", default, skip_serializing_if = "Option::is_none")] - pub enable_early_termination: Option, - #[doc = "Exit score for the AutoML job."] - #[serde(rename = "exitScore", default, skip_serializing_if = "Option::is_none")] - pub exit_score: Option, - #[doc = "Maximum Concurrent iterations."] - #[serde(rename = "maxConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub max_concurrent_trials: Option, - #[doc = "Max cores per iteration."] - #[serde(rename = "maxCoresPerTrial", default, skip_serializing_if = "Option::is_none")] - pub max_cores_per_trial: Option, - #[doc = "Maximum nodes to use for the experiment."] - #[serde(rename = "maxNodes", default, skip_serializing_if = "Option::is_none")] - pub max_nodes: Option, - #[doc = "Number of iterations."] - #[serde(rename = "maxTrials", default, skip_serializing_if = "Option::is_none")] - pub max_trials: Option, - #[doc = "Number of concurrent sweeping runs that user wants to trigger."] - #[serde(rename = "sweepConcurrentTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_concurrent_trials: Option, - #[doc = "Number of sweeping runs that user wants to trigger."] - #[serde(rename = "sweepTrials", default, skip_serializing_if = "Option::is_none")] - pub sweep_trials: Option, - #[doc = "AutoML job timeout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[doc = "Iteration timeout."] - #[serde(rename = "trialTimeout", default, skip_serializing_if = "Option::is_none")] - pub trial_timeout: Option, -} -impl TableVerticalLimitSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Target aggregate function."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetAggregationFunction")] -pub enum TargetAggregationFunction { - None, - Sum, - Max, - Min, - Mean, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetAggregationFunction { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetAggregationFunction { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetAggregationFunction { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("TargetAggregationFunction", 0u32, "None"), - Self::Sum => serializer.serialize_unit_variant("TargetAggregationFunction", 1u32, "Sum"), - Self::Max => serializer.serialize_unit_variant("TargetAggregationFunction", 2u32, "Max"), - Self::Min => serializer.serialize_unit_variant("TargetAggregationFunction", 3u32, "Min"), - Self::Mean => serializer.serialize_unit_variant("TargetAggregationFunction", 4u32, "Mean"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The number of past periods to lag from the target column."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetLags { - #[doc = "Target lags selection modes."] - pub mode: TargetLagsMode, -} -impl TargetLags { - pub fn new(mode: TargetLagsMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum TargetLagsUnion { - Auto(AutoTargetLags), - Custom(CustomTargetLags), -} -#[doc = "Target lags selection modes."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetLagsMode")] -pub enum TargetLagsMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetLagsMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetLagsMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetLagsMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TargetLagsMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("TargetLagsMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Forecasting target rolling window size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetRollingWindowSize { - #[doc = "Target rolling windows size mode."] - pub mode: TargetRollingWindowSizeMode, -} -impl TargetRollingWindowSize { - pub fn new(mode: TargetRollingWindowSizeMode) -> Self { - Self { mode } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "mode")] -pub enum TargetRollingWindowSizeUnion { - Auto(AutoTargetRollingWindowSize), - Custom(CustomTargetRollingWindowSize), -} -#[doc = "Target rolling windows size mode."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TargetRollingWindowSizeMode")] -pub enum TargetRollingWindowSizeMode { - Auto, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TargetRollingWindowSizeMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TargetRollingWindowSizeMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TargetRollingWindowSizeMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TargetRollingWindowSizeMode", 0u32, "Auto"), - Self::Custom => serializer.serialize_unit_variant("TargetRollingWindowSizeMode", 1u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TargetUtilizationScaleSettings { - #[serde(flatten)] - pub online_scale_settings: OnlineScaleSettings, - #[doc = "The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances."] - #[serde(rename = "maxInstances", default, skip_serializing_if = "Option::is_none")] - pub max_instances: Option, - #[doc = "The minimum number of instances to always be present."] - #[serde(rename = "minInstances", default, skip_serializing_if = "Option::is_none")] - pub min_instances: Option, - #[doc = "The polling interval in ISO 8691 format. Only supports duration with precision as low as Seconds."] - #[serde(rename = "pollingInterval", default, skip_serializing_if = "Option::is_none")] - pub polling_interval: Option, - #[doc = "Target CPU usage for the autoscaler."] - #[serde(rename = "targetUtilizationPercentage", default, skip_serializing_if = "Option::is_none")] - pub target_utilization_percentage: Option, -} -impl TargetUtilizationScaleSettings { - pub fn new(online_scale_settings: OnlineScaleSettings) -> Self { - Self { - online_scale_settings, - max_instances: None, - min_instances: None, - polling_interval: None, - target_utilization_percentage: None, - } - } -} -#[doc = "AutoMLJob Task type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TaskType")] -pub enum TaskType { - Classification, - Regression, - Forecasting, - ImageClassification, - ImageClassificationMultilabel, - ImageObjectDetection, - ImageInstanceSegmentation, - TextClassification, - TextClassificationMultilabel, - #[serde(rename = "TextNER")] - TextNer, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TaskType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TaskType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TaskType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TaskType", 0u32, "Classification"), - Self::Regression => serializer.serialize_unit_variant("TaskType", 1u32, "Regression"), - Self::Forecasting => serializer.serialize_unit_variant("TaskType", 2u32, "Forecasting"), - Self::ImageClassification => serializer.serialize_unit_variant("TaskType", 3u32, "ImageClassification"), - Self::ImageClassificationMultilabel => serializer.serialize_unit_variant("TaskType", 4u32, "ImageClassificationMultilabel"), - Self::ImageObjectDetection => serializer.serialize_unit_variant("TaskType", 5u32, "ImageObjectDetection"), - Self::ImageInstanceSegmentation => serializer.serialize_unit_variant("TaskType", 6u32, "ImageInstanceSegmentation"), - Self::TextClassification => serializer.serialize_unit_variant("TaskType", 7u32, "TextClassification"), - Self::TextClassificationMultilabel => serializer.serialize_unit_variant("TaskType", 8u32, "TextClassificationMultilabel"), - Self::TextNer => serializer.serialize_unit_variant("TaskType", 9u32, "TextNER"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "TensorFlow distribution configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TensorFlow { - #[serde(flatten)] - pub distribution_configuration: DistributionConfiguration, - #[doc = "Number of parameter server tasks."] - #[serde(rename = "parameterServerCount", default, skip_serializing_if = "Option::is_none")] - pub parameter_server_count: Option, - #[doc = "Number of workers. If not specified, will default to the instance count."] - #[serde(rename = "workerCount", default, skip_serializing_if = "Option::is_none")] - pub worker_count: Option, -} -impl TensorFlow { - pub fn new(distribution_configuration: DistributionConfiguration) -> Self { - Self { - distribution_configuration, - parameter_server_count: None, - worker_count: None, - } - } -} -#[doc = "Annotation type of text data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TextAnnotationType")] -pub enum TextAnnotationType { - Classification, - NamedEntityRecognition, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TextAnnotationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TextAnnotationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TextAnnotationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Classification => serializer.serialize_unit_variant("TextAnnotationType", 0u32, "Classification"), - Self::NamedEntityRecognition => serializer.serialize_unit_variant("TextAnnotationType", 1u32, "NamedEntityRecognition"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Text Classification task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextClassification { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextClassification { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Text Classification Multilabel task in AutoML NLP vertical.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextClassificationMultilabel { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification multilabel tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextClassificationMultilabel { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[doc = "Text-NER task in AutoML NLP vertical.\r\nNER - Named Entity Recognition.\r\nNLP - Natural Language Processing."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TextNer { - #[serde(flatten)] - pub nlp_vertical: NlpVertical, - #[serde(flatten)] - pub auto_ml_vertical: AutoMlVertical, - #[doc = "Primary metrics for classification tasks."] - #[serde(rename = "primaryMetric", default, skip_serializing_if = "Option::is_none")] - pub primary_metric: Option, -} -impl TextNer { - pub fn new(auto_ml_vertical: AutoMlVertical) -> Self { - Self { - nlp_vertical: NlpVertical::default(), - auto_ml_vertical, - primary_metric: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TmpfsOptions { - #[doc = "Mention the Tmpfs size"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, -} -impl TmpfsOptions { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TopNFeaturesByAttribution { - #[serde(flatten)] - pub monitoring_feature_filter_base: MonitoringFeatureFilterBase, - #[doc = "The number of top features to include."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub top: Option, -} -impl TopNFeaturesByAttribution { - pub fn new(monitoring_feature_filter_base: MonitoringFeatureFilterBase) -> Self { - Self { - monitoring_feature_filter_base, - top: None, - } - } -} -#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrackedResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The geo-location where the resource lives"] - pub location: String, -} -impl TrackedResource { - pub fn new(location: String) -> Self { - Self { - resource: Resource::default(), - tags: None, - location, - } - } -} -#[doc = "Trailing input data definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrailingInputData { - #[serde(flatten)] - pub monitoring_input_data_base: MonitoringInputDataBase, - #[doc = "The ARM resource ID of the component resource used to preprocess the data."] - #[serde(rename = "preprocessingComponentId", default, skip_serializing_if = "Option::is_none")] - pub preprocessing_component_id: Option, - #[doc = "[Required] The time offset between the end of the data window and the monitor's current run time."] - #[serde(rename = "windowOffset")] - pub window_offset: String, - #[doc = "[Required] The size of the trailing data window."] - #[serde(rename = "windowSize")] - pub window_size: String, -} -impl TrailingInputData { - pub fn new(monitoring_input_data_base: MonitoringInputDataBase, window_offset: String, window_size: String) -> Self { - Self { - monitoring_input_data_base, - preprocessing_component_id: None, - window_offset, - window_size, - } - } -} -#[doc = "Training mode dictates whether to use distributed training or not"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TrainingMode")] -pub enum TrainingMode { - Auto, - Distributed, - NonDistributed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TrainingMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TrainingMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TrainingMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Auto => serializer.serialize_unit_variant("TrainingMode", 0u32, "Auto"), - Self::Distributed => serializer.serialize_unit_variant("TrainingMode", 1u32, "Distributed"), - Self::NonDistributed => serializer.serialize_unit_variant("TrainingMode", 2u32, "NonDistributed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Training related configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TrainingSettings { - #[doc = "Enable recommendation of DNN models."] - #[serde(rename = "enableDnnTraining", default, skip_serializing_if = "Option::is_none")] - pub enable_dnn_training: Option, - #[doc = "Flag to turn on explainability on best model."] - #[serde(rename = "enableModelExplainability", default, skip_serializing_if = "Option::is_none")] - pub enable_model_explainability: Option, - #[doc = "Flag for enabling onnx compatible models."] - #[serde(rename = "enableOnnxCompatibleModels", default, skip_serializing_if = "Option::is_none")] - pub enable_onnx_compatible_models: Option, - #[doc = "Enable stack ensemble run."] - #[serde(rename = "enableStackEnsemble", default, skip_serializing_if = "Option::is_none")] - pub enable_stack_ensemble: Option, - #[doc = "Enable voting ensemble run."] - #[serde(rename = "enableVoteEnsemble", default, skip_serializing_if = "Option::is_none")] - pub enable_vote_ensemble: Option, - #[doc = "During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded.\r\nConfigure this parameter with a higher value than 300 secs, if more time is needed."] - #[serde(rename = "ensembleModelDownloadTimeout", default, skip_serializing_if = "Option::is_none")] - pub ensemble_model_download_timeout: Option, - #[doc = "Advances setting to customize StackEnsemble run."] - #[serde(rename = "stackEnsembleSettings", default, skip_serializing_if = "Option::is_none")] - pub stack_ensemble_settings: Option, - #[doc = "Training mode dictates whether to use distributed training or not"] - #[serde(rename = "trainingMode", default, skip_serializing_if = "Option::is_none")] - pub training_mode: Option, -} -impl TrainingSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Trial component definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrialComponent { - #[doc = "ARM resource ID of the code asset."] - #[serde(rename = "codeId", default, skip_serializing_if = "Option::is_none")] - pub code_id: Option, - #[doc = "[Required] The command to execute on startup of the job. eg. \"python train.py\""] - pub command: String, - #[doc = "Base definition for job distribution configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option, - #[doc = "[Required] The ARM resource ID of the Environment specification for the job."] - #[serde(rename = "environmentId")] - pub environment_id: String, - #[doc = "Environment variables included in the job."] - #[serde(rename = "environmentVariables", default, skip_serializing_if = "Option::is_none")] - pub environment_variables: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl TrialComponent { - pub fn new(command: String, environment_id: String) -> Self { - Self { - code_id: None, - command, - distribution: None, - environment_id, - environment_variables: None, - resources: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TriggerBase { - #[doc = "Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601.\r\nRecommented format would be \"2022-06-01T00:00:01\"\r\nIf not present, the schedule will run indefinitely"] - #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "Specifies start time of schedule in ISO 8601 format, but without a UTC offset."] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11"] - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option, - #[serde(rename = "triggerType")] - pub trigger_type: TriggerType, -} -impl TriggerBase { - pub fn new(trigger_type: TriggerType) -> Self { - Self { - end_time: None, - start_time: None, - time_zone: None, - trigger_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "triggerType")] -pub enum TriggerBaseUnion { - Cron(CronTrigger), - Recurrence(RecurrenceTrigger), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "TriggerType")] -pub enum TriggerType { - Recurrence, - Cron, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for TriggerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for TriggerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for TriggerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Recurrence => serializer.serialize_unit_variant("TriggerType", 0u32, "Recurrence"), - Self::Cron => serializer.serialize_unit_variant("TriggerType", 1u32, "Cron"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Triton inferencing server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TritonInferencingServer { - #[serde(flatten)] - pub inferencing_server: InferencingServer, - #[doc = "Online inference configuration options."] - #[serde(rename = "inferenceConfiguration", default, skip_serializing_if = "Option::is_none")] - pub inference_configuration: Option, -} -impl TritonInferencingServer { - pub fn new(inferencing_server: InferencingServer) -> Self { - Self { - inferencing_server, - inference_configuration: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TritonModelJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl TritonModelJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TritonModelJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl TritonModelJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "Defines an early termination policy that cancels a given percentage of runs at each evaluation interval."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TruncationSelectionPolicy { - #[serde(flatten)] - pub early_termination_policy: EarlyTerminationPolicy, - #[doc = "The percentage of runs to cancel at each evaluation interval."] - #[serde(rename = "truncationPercentage", default, skip_serializing_if = "Option::is_none")] - pub truncation_percentage: Option, -} -impl TruncationSelectionPolicy { - pub fn new(early_termination_policy: EarlyTerminationPolicy) -> Self { - Self { - early_termination_policy, - truncation_percentage: None, - } - } -} -#[doc = "The properties for update Quota response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UpdateWorkspaceQuotas { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The maximum permitted quota of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "An enum describing the unit of quota measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "Status of update workspace quota."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl UpdateWorkspaceQuotas { - pub fn new() -> Self { - Self::default() - } -} -pub mod update_workspace_quotas { - use super::*; - #[doc = "An enum describing the unit of quota measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Status of update workspace quota."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Undefined, - Success, - Failure, - InvalidQuotaBelowClusterMinimum, - InvalidQuotaExceedsSubscriptionLimit, - #[serde(rename = "InvalidVMFamilyName")] - InvalidVmFamilyName, - OperationNotSupportedForSku, - OperationNotEnabledForRegion, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Undefined => serializer.serialize_unit_variant("Status", 0u32, "Undefined"), - Self::Success => serializer.serialize_unit_variant("Status", 1u32, "Success"), - Self::Failure => serializer.serialize_unit_variant("Status", 2u32, "Failure"), - Self::InvalidQuotaBelowClusterMinimum => { - serializer.serialize_unit_variant("Status", 3u32, "InvalidQuotaBelowClusterMinimum") - } - Self::InvalidQuotaExceedsSubscriptionLimit => { - serializer.serialize_unit_variant("Status", 4u32, "InvalidQuotaExceedsSubscriptionLimit") - } - Self::InvalidVmFamilyName => serializer.serialize_unit_variant("Status", 5u32, "InvalidVMFamilyName"), - Self::OperationNotSupportedForSku => serializer.serialize_unit_variant("Status", 6u32, "OperationNotSupportedForSku"), - Self::OperationNotEnabledForRegion => serializer.serialize_unit_variant("Status", 7u32, "OperationNotEnabledForRegion"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The result of update workspace quota."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UpdateWorkspaceQuotasResult { - #[doc = "The list of workspace quota update result."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl UpdateWorkspaceQuotasResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "uri-file data version entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFileDataVersion { - #[serde(flatten)] - pub data_version_base: DataVersionBase, -} -impl UriFileDataVersion { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { data_version_base } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFileJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl UriFileJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFileJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl UriFileJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "uri-folder data version entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFolderDataVersion { - #[serde(flatten)] - pub data_version_base: DataVersionBase, -} -impl UriFolderDataVersion { - pub fn new(data_version_base: DataVersionBase) -> Self { - Self { data_version_base } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFolderJobInput { - #[serde(flatten)] - pub asset_job_input: AssetJobInput, - #[serde(flatten)] - pub job_input: JobInput, -} -impl UriFolderJobInput { - pub fn new(asset_job_input: AssetJobInput, job_input: JobInput) -> Self { - Self { - asset_job_input, - job_input, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UriFolderJobOutput { - #[serde(flatten)] - pub asset_job_output: AssetJobOutput, - #[serde(flatten)] - pub job_output: JobOutput, -} -impl UriFolderJobOutput { - pub fn new(job_output: JobOutput) -> Self { - Self { - asset_job_output: AssetJobOutput::default(), - job_output, - } - } -} -#[doc = "Describes AML Resource Usage."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Usage { - #[doc = "Specifies the resource ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Region of the AML workspace in the id."] - #[serde(rename = "amlWorkspaceLocation", default, skip_serializing_if = "Option::is_none")] - pub aml_workspace_location: Option, - #[doc = "Specifies the resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "An enum describing the unit of usage measurement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "The current usage of the resource."] - #[serde(rename = "currentValue", default, skip_serializing_if = "Option::is_none")] - pub current_value: Option, - #[doc = "The maximum permitted usage of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[doc = "The Usage Names."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, -} -impl Usage { - pub fn new() -> Self { - Self::default() - } -} -pub mod usage { - use super::*; - #[doc = "An enum describing the unit of usage measurement."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Unit")] - pub enum Unit { - Count, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Unit { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Unit { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Unit { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Count => serializer.serialize_unit_variant("Unit", 0u32, "Count"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The Usage Names."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UsageName { - #[doc = "The name of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The localized name of the resource."] - #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] - pub localized_value: Option, -} -impl UsageName { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Configure STL Decomposition of the time-series target column."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "UseStl")] -pub enum UseStl { - None, - Season, - SeasonTrend, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for UseStl { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for UseStl { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for UseStl { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("UseStl", 0u32, "None"), - Self::Season => serializer.serialize_unit_variant("UseStl", 1u32, "Season"), - Self::SeasonTrend => serializer.serialize_unit_variant("UseStl", 2u32, "SeasonTrend"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Settings for user account that gets created on each on the nodes of a compute."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserAccountCredentials { - #[doc = "Name of the administrator user account which can be used to SSH to nodes."] - #[serde(rename = "adminUserName")] - pub admin_user_name: String, - #[doc = "SSH public key of the administrator user account."] - #[serde(rename = "adminUserSshPublicKey", default, skip_serializing_if = "Option::is_none")] - pub admin_user_ssh_public_key: Option, - #[doc = "Password of the administrator user account."] - #[serde(rename = "adminUserPassword", default, skip_serializing_if = "Option::is_none")] - pub admin_user_password: Option, -} -impl UserAccountCredentials { - pub fn new(admin_user_name: String) -> Self { - Self { - admin_user_name, - admin_user_ssh_public_key: None, - admin_user_password: None, - } - } -} -#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserAssignedIdentities {} -impl UserAssignedIdentities { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "User assigned identity properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserAssignedIdentity { - #[doc = "The principal ID of the assigned identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The client ID of the assigned identity."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, -} -impl UserAssignedIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedAcrAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedAcrAccount { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserCreatedStorageAccount { - #[doc = "ARM ResourceId of a resource"] - #[serde(rename = "armResourceId", default, skip_serializing_if = "Option::is_none")] - pub arm_resource_id: Option, -} -impl UserCreatedStorageAccount { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "User identity configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserIdentity { - #[serde(flatten)] - pub identity_configuration: IdentityConfiguration, -} -impl UserIdentity { - pub fn new(identity_configuration: IdentityConfiguration) -> Self { - Self { identity_configuration } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct UsernamePasswordAuthTypeWorkspaceConnectionProperties { - #[serde(flatten)] - pub workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub credentials: Option, -} -impl UsernamePasswordAuthTypeWorkspaceConnectionProperties { - pub fn new(workspace_connection_properties_v2: WorkspaceConnectionPropertiesV2) -> Self { - Self { - workspace_connection_properties_v2, - credentials: None, - } - } -} -#[doc = "Metric computation method to use for validation metrics in image tasks."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ValidationMetricType")] -pub enum ValidationMetricType { - None, - Coco, - Voc, - CocoVoc, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ValidationMetricType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ValidationMetricType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ValidationMetricType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("ValidationMetricType", 0u32, "None"), - Self::Coco => serializer.serialize_unit_variant("ValidationMetricType", 1u32, "Coco"), - Self::Voc => serializer.serialize_unit_variant("ValidationMetricType", 2u32, "Voc"), - Self::CocoVoc => serializer.serialize_unit_variant("ValidationMetricType", 3u32, "CocoVoc"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A Machine Learning compute based on Azure Virtual Machines."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct VirtualMachine { - #[serde(flatten)] - pub compute: Compute, - #[serde(flatten)] - pub virtual_machine_schema: VirtualMachineSchema, -} -impl VirtualMachine { - pub fn new(compute: Compute) -> Self { - Self { - compute, - virtual_machine_schema: VirtualMachineSchema::default(), - } - } -} -#[doc = "Virtual Machine image for Windows AML Compute"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct VirtualMachineImage { - #[doc = "Virtual Machine image path"] - pub id: String, -} -impl VirtualMachineImage { - pub fn new(id: String) -> Self { - Self { id } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSchema { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl VirtualMachineSchema { - pub fn new() -> Self { - Self::default() - } -} -pub mod virtual_machine_schema { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Virtual Machine size"] - #[serde(rename = "virtualMachineSize", default, skip_serializing_if = "Option::is_none")] - pub virtual_machine_size: Option, - #[doc = "Port open for ssh connections."] - #[serde(rename = "sshPort", default, skip_serializing_if = "Option::is_none")] - pub ssh_port: Option, - #[doc = "Notebook server port open for ssh connections."] - #[serde(rename = "notebookServerPort", default, skip_serializing_if = "Option::is_none")] - pub notebook_server_port: Option, - #[doc = "Public IP address of the virtual machine."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - #[doc = "Admin credentials for virtual machine"] - #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] - pub administrator_account: Option, - #[doc = "Indicates whether this compute will be used for running notebooks."] - #[serde(rename = "isNotebookInstanceCompute", default, skip_serializing_if = "Option::is_none")] - pub is_notebook_instance_compute: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Secrets related to a Machine Learning compute based on AKS."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct VirtualMachineSecrets { - #[serde(flatten)] - pub compute_secrets: ComputeSecrets, - #[serde(flatten)] - pub virtual_machine_secrets_schema: VirtualMachineSecretsSchema, -} -impl VirtualMachineSecrets { - pub fn new(compute_secrets: ComputeSecrets) -> Self { - Self { - compute_secrets, - virtual_machine_secrets_schema: VirtualMachineSecretsSchema::default(), - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSecretsSchema { - #[doc = "Admin credentials for virtual machine"] - #[serde(rename = "administratorAccount", default, skip_serializing_if = "Option::is_none")] - pub administrator_account: Option, -} -impl VirtualMachineSecretsSchema { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes the properties of a VM size."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSize { - #[doc = "The name of the virtual machine size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The family name of the virtual machine size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "The number of vCPUs supported by the virtual machine size."] - #[serde(rename = "vCPUs", default, skip_serializing_if = "Option::is_none")] - pub v_cp_us: Option, - #[doc = "The number of gPUs supported by the virtual machine size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gpus: Option, - #[doc = "The OS VHD disk size, in MB, allowed by the virtual machine size."] - #[serde(rename = "osVhdSizeMB", default, skip_serializing_if = "Option::is_none")] - pub os_vhd_size_mb: Option, - #[doc = "The resource volume size, in MB, allowed by the virtual machine size."] - #[serde(rename = "maxResourceVolumeMB", default, skip_serializing_if = "Option::is_none")] - pub max_resource_volume_mb: Option, - #[doc = "The amount of memory, in GB, supported by the virtual machine size."] - #[serde(rename = "memoryGB", default, skip_serializing_if = "Option::is_none")] - pub memory_gb: Option, - #[doc = "Specifies if the virtual machine size supports low priority VMs."] - #[serde(rename = "lowPriorityCapable", default, skip_serializing_if = "Option::is_none")] - pub low_priority_capable: Option, - #[doc = "Specifies if the virtual machine size supports premium IO."] - #[serde(rename = "premiumIO", default, skip_serializing_if = "Option::is_none")] - pub premium_io: Option, - #[doc = "The estimated price info for using a VM."] - #[serde(rename = "estimatedVMPrices", default, skip_serializing_if = "Option::is_none")] - pub estimated_vm_prices: Option, - #[doc = "Specifies the compute types supported by the virtual machine size."] - #[serde( - rename = "supportedComputeTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_compute_types: Vec, -} -impl VirtualMachineSize { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The List Virtual Machine size operation response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSizeListResult { - #[doc = "The list of virtual machine sizes supported by AmlCompute."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl VirtualMachineSizeListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Admin credentials for virtual machine"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualMachineSshCredentials { - #[doc = "Username of admin account"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[doc = "Password of admin account"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, - #[doc = "Public key data"] - #[serde(rename = "publicKeyData", default, skip_serializing_if = "Option::is_none")] - pub public_key_data: Option, - #[doc = "Private key data"] - #[serde(rename = "privateKeyData", default, skip_serializing_if = "Option::is_none")] - pub private_key_data: Option, -} -impl VirtualMachineSshCredentials { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeDefinition { - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Indicate whether to mount volume as readOnly. Default value for this is false."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option, - #[doc = "Source of the mount. For bind mounts this is the host path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Target of the mount. For bind mounts this is the path in the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "Consistency of the volume"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub consistency: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bind: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub volume: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tmpfs: Option, -} -impl VolumeDefinition { - pub fn new() -> Self { - Self::default() - } -} -pub mod volume_definition { - use super::*; - #[doc = "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - #[serde(rename = "bind")] - Bind, - #[serde(rename = "volume")] - Volume, - #[serde(rename = "tmpfs")] - Tmpfs, - #[serde(rename = "npipe")] - Npipe, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Bind => serializer.serialize_unit_variant("Type", 0u32, "bind"), - Self::Volume => serializer.serialize_unit_variant("Type", 1u32, "volume"), - Self::Tmpfs => serializer.serialize_unit_variant("Type", 2u32, "tmpfs"), - Self::Npipe => serializer.serialize_unit_variant("Type", 3u32, "npipe"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Type { - fn default() -> Self { - Self::Bind - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VolumeOptions { - #[doc = "Indicate whether volume is nocopy"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nocopy: Option, -} -impl VolumeOptions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Webhook base"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Webhook { - #[doc = "Send callback on a specified notification event"] - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option, - #[doc = "Enum to determine the webhook callback service type."] - #[serde(rename = "webhookType")] - pub webhook_type: WebhookType, -} -impl Webhook { - pub fn new(webhook_type: WebhookType) -> Self { - Self { - event_type: None, - webhook_type, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "webhookType")] -pub enum WebhookUnion { - AzureDevOps(AzureDevOpsWebhook), -} -#[doc = "Enum to determine the webhook callback service type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "WebhookType")] -pub enum WebhookType { - AzureDevOps, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for WebhookType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for WebhookType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for WebhookType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureDevOps => serializer.serialize_unit_variant("WebhookType", 0u32, "AzureDevOps"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Enum of weekday"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "WeekDay")] -pub enum WeekDay { - Monday, - Tuesday, - Wednesday, - Thursday, - Friday, - Saturday, - Sunday, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for WeekDay { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for WeekDay { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for WeekDay { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Monday => serializer.serialize_unit_variant("WeekDay", 0u32, "Monday"), - Self::Tuesday => serializer.serialize_unit_variant("WeekDay", 1u32, "Tuesday"), - Self::Wednesday => serializer.serialize_unit_variant("WeekDay", 2u32, "Wednesday"), - Self::Thursday => serializer.serialize_unit_variant("WeekDay", 3u32, "Thursday"), - Self::Friday => serializer.serialize_unit_variant("WeekDay", 4u32, "Friday"), - Self::Saturday => serializer.serialize_unit_variant("WeekDay", 5u32, "Saturday"), - Self::Sunday => serializer.serialize_unit_variant("WeekDay", 6u32, "Sunday"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "An object that represents a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Workspace { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "The properties of a machine learning workspace."] - pub properties: WorkspaceProperties, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl Workspace { - pub fn new(properties: WorkspaceProperties) -> Self { - Self { - resource: Resource::default(), - identity: None, - kind: None, - location: None, - properties, - sku: None, - tags: None, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionAccessKey { - #[serde(rename = "accessKeyId", default, skip_serializing_if = "Option::is_none")] - pub access_key_id: Option, - #[serde(rename = "secretAccessKey", default, skip_serializing_if = "Option::is_none")] - pub secret_access_key: Option, -} -impl WorkspaceConnectionAccessKey { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Api key object for workspace connection credential."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionApiKey { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option, -} -impl WorkspaceConnectionApiKey { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionManagedIdentity { - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, -} -impl WorkspaceConnectionManagedIdentity { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionPersonalAccessToken { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pat: Option, -} -impl WorkspaceConnectionPersonalAccessToken { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WorkspaceConnectionPropertiesV2 { - #[doc = "Authentication type of the connection target"] - #[serde(rename = "authType")] - pub auth_type: ConnectionAuthType, - #[doc = "Category of the connection"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[serde(rename = "expiryTime", default, with = "azure_core::date::rfc3339::option")] - pub expiry_time: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, -} -impl WorkspaceConnectionPropertiesV2 { - pub fn new(auth_type: ConnectionAuthType) -> Self { - Self { - auth_type, - category: None, - expiry_time: None, - metadata: None, - target: None, - } - } -} -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "authType")] -pub enum WorkspaceConnectionPropertiesV2Union { - AccessKey(AccessKeyAuthTypeWorkspaceConnectionProperties), - ApiKey(ApiKeyAuthWorkspaceConnectionProperties), - CustomKeys(CustomKeysWorkspaceConnectionProperties), - ManagedIdentity(ManagedIdentityAuthTypeWorkspaceConnectionProperties), - None(NoneAuthTypeWorkspaceConnectionProperties), - #[serde(rename = "PAT")] - Pat(PatAuthTypeWorkspaceConnectionProperties), - #[serde(rename = "SAS")] - Sas(SasAuthTypeWorkspaceConnectionProperties), - ServicePrincipal(ServicePrincipalAuthTypeWorkspaceConnectionProperties), - UsernamePassword(UsernamePasswordAuthTypeWorkspaceConnectionProperties), -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WorkspaceConnectionPropertiesV2BasicResource { - #[serde(flatten)] - pub resource: Resource, - pub properties: WorkspaceConnectionPropertiesV2Union, -} -impl WorkspaceConnectionPropertiesV2BasicResource { - pub fn new(properties: WorkspaceConnectionPropertiesV2Union) -> Self { - Self { - resource: Resource::default(), - properties, - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionServicePrincipal { - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, -} -impl WorkspaceConnectionServicePrincipal { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionSharedAccessSignature { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sas: Option, -} -impl WorkspaceConnectionSharedAccessSignature { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties that the machine learning workspace connection will be updated with."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionUpdateParameter { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl WorkspaceConnectionUpdateParameter { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceConnectionUsernamePassword { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, -} -impl WorkspaceConnectionUsernamePassword { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "WorkspaceHub's configuration object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceHubConfig { - #[serde( - rename = "additionalWorkspaceStorageAccounts", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_workspace_storage_accounts: Vec, - #[serde(rename = "defaultWorkspaceResourceGroup", default, skip_serializing_if = "Option::is_none")] - pub default_workspace_resource_group: Option, -} -impl WorkspaceHubConfig { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The result of a request to list machine learning workspaces."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceListResult { - #[doc = "The link to the next page constructed using the continuationToken. If null, there are no additional pages."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for WorkspaceListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone().filter(|value| !value.is_empty()) - } -} -impl WorkspaceListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The Private Endpoint resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspacePrivateEndpointResource { - #[doc = "e.g. /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The subnetId that the private endpoint is connected to."] - #[serde(rename = "subnetArmId", default, skip_serializing_if = "Option::is_none")] - pub subnet_arm_id: Option, -} -impl WorkspacePrivateEndpointResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceProperties { - #[doc = "The flag to indicate whether to allow public access when behind VNet."] - #[serde(rename = "allowPublicAccessWhenBehindVnet", default, skip_serializing_if = "Option::is_none")] - pub allow_public_access_when_behind_vnet: Option, - #[doc = "ARM id of the application insights associated with this workspace."] - #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] - pub application_insights: Option, - #[serde( - rename = "associatedWorkspaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub associated_workspaces: Vec, - #[serde( - rename = "containerRegistries", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub container_registries: Vec, - #[doc = "ARM id of the container registry associated with this workspace."] - #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] - pub container_registry: Option, - #[doc = "The description of this workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Url for the discovery service to identify regional endpoints for machine learning experimentation services"] - #[serde(rename = "discoveryUrl", default, skip_serializing_if = "Option::is_none")] - pub discovery_url: Option, - #[serde(rename = "enableDataIsolation", default, skip_serializing_if = "Option::is_none")] - pub enable_data_isolation: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encryption: Option, - #[serde( - rename = "existingWorkspaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub existing_workspaces: Vec, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, - #[doc = "The friendly name for this workspace. This name in mutable"] - #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[doc = "The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service"] - #[serde(rename = "hbiWorkspace", default, skip_serializing_if = "Option::is_none")] - pub hbi_workspace: Option, - #[serde(rename = "hubResourceId", default, skip_serializing_if = "Option::is_none")] - pub hub_resource_id: Option, - #[doc = "The compute name for image build"] - #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] - pub image_build_compute: Option, - #[doc = "ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created"] - #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] - pub key_vault: Option, - #[serde( - rename = "keyVaults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub key_vaults: Vec, - #[doc = "Managed Network settings for a machine learning workspace."] - #[serde(rename = "managedNetwork", default, skip_serializing_if = "Option::is_none")] - pub managed_network: Option, - #[doc = "The URI associated with this workspace that machine learning flow must point at to set up tracking."] - #[serde(rename = "mlFlowTrackingUri", default, skip_serializing_if = "Option::is_none")] - pub ml_flow_tracking_uri: Option, - #[serde(rename = "notebookInfo", default, skip_serializing_if = "Option::is_none")] - pub notebook_info: Option, - #[doc = "The user assigned identity resource id that represents the workspace identity."] - #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub primary_user_assigned_identity: Option, - #[doc = "The list of private endpoint connections in the workspace."] - #[serde( - rename = "privateEndpointConnections", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub private_endpoint_connections: Vec, - #[doc = "Count of private connections in the workspace"] - #[serde(rename = "privateLinkCount", default, skip_serializing_if = "Option::is_none")] - pub private_link_count: Option, - #[doc = "The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "The public network access flag."] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] - pub service_managed_resources_settings: Option, - #[doc = "The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace"] - #[serde(rename = "serviceProvisionedResourceGroup", default, skip_serializing_if = "Option::is_none")] - pub service_provisioned_resource_group: Option, - #[doc = "The list of shared private link resources in this workspace."] - #[serde( - rename = "sharedPrivateLinkResources", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub shared_private_link_resources: Vec, - #[doc = "Retention time in days after workspace get soft deleted."] - #[serde(rename = "softDeleteRetentionInDays", default, skip_serializing_if = "Option::is_none")] - pub soft_delete_retention_in_days: Option, - #[doc = "ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created"] - #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] - pub storage_account: Option, - #[serde( - rename = "storageAccounts", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub storage_accounts: Vec, - #[doc = "If the storage associated with the workspace has hierarchical namespace(HNS) enabled."] - #[serde(rename = "storageHnsEnabled", default, skip_serializing_if = "Option::is_none")] - pub storage_hns_enabled: Option, - #[doc = "The auth mode used for accessing the system datastores of the workspace."] - #[serde(rename = "systemDatastoresAuthMode", default, skip_serializing_if = "Option::is_none")] - pub system_datastores_auth_mode: Option, - #[doc = "The tenant id associated with this workspace."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "Enabling v1_legacy_mode may prevent you from using features provided by the v2 API."] - #[serde(rename = "v1LegacyMode", default, skip_serializing_if = "Option::is_none")] - pub v1_legacy_mode: Option, - #[doc = "WorkspaceHub's configuration object."] - #[serde(rename = "workspaceHubConfig", default, skip_serializing_if = "Option::is_none")] - pub workspace_hub_config: Option, - #[doc = "The immutable id associated with this workspace."] - #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] - pub workspace_id: Option, -} -impl WorkspaceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The parameters for updating a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspacePropertiesUpdateParameters { - #[doc = "ARM id of the application insights associated with this workspace."] - #[serde(rename = "applicationInsights", default, skip_serializing_if = "Option::is_none")] - pub application_insights: Option, - #[doc = "ARM id of the container registry associated with this workspace."] - #[serde(rename = "containerRegistry", default, skip_serializing_if = "Option::is_none")] - pub container_registry: Option, - #[doc = "The description of this workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(rename = "enableDataIsolation", default, skip_serializing_if = "Option::is_none")] - pub enable_data_isolation: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encryption: Option, - #[serde(rename = "featureStoreSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_store_settings: Option, - #[doc = "The friendly name for this workspace. This name in mutable"] - #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[doc = "The compute name for image build"] - #[serde(rename = "imageBuildCompute", default, skip_serializing_if = "Option::is_none")] - pub image_build_compute: Option, - #[doc = "Managed Network settings for a machine learning workspace."] - #[serde(rename = "managedNetwork", default, skip_serializing_if = "Option::is_none")] - pub managed_network: Option, - #[doc = "The user assigned identity resource id that represents the workspace identity."] - #[serde(rename = "primaryUserAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub primary_user_assigned_identity: Option, - #[doc = "The public network access flag."] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[serde(rename = "serviceManagedResourcesSettings", default, skip_serializing_if = "Option::is_none")] - pub service_managed_resources_settings: Option, - #[doc = "Retention time in days after workspace get soft deleted."] - #[serde(rename = "softDeleteRetentionInDays", default, skip_serializing_if = "Option::is_none")] - pub soft_delete_retention_in_days: Option, - #[doc = "Enabling v1_legacy_mode may prevent you from using features provided by the v2 API."] - #[serde(rename = "v1LegacyMode", default, skip_serializing_if = "Option::is_none")] - pub v1_legacy_mode: Option, -} -impl WorkspacePropertiesUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The parameters for updating a machine learning workspace."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkspaceUpdateParameters { - #[doc = "Managed service identity (system assigned and/or user assigned identities)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "The parameters for updating a machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "The resource model definition representing SKU"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[doc = "The resource tags for the machine learning workspace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl WorkspaceUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Metadata pertaining to creation and last modification of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemData { - #[doc = "The identity that created the resource."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The type of identity that created the resource."] - #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] - pub created_by_type: Option, - #[doc = "The timestamp of resource creation (UTC)."] - #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] - pub created_at: Option, - #[doc = "The identity that last modified the resource."] - #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by: Option, - #[doc = "The type of identity that last modified the resource."] - #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] - #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] - pub last_modified_at: Option, -} -impl SystemData { - pub fn new() -> Self { - Self::default() - } -} -pub mod system_data { - use super::*; - #[doc = "The type of identity that created the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreatedByType")] - pub enum CreatedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreatedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreatedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreatedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of identity that last modified the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LastModifiedByType")] - pub enum LastModifiedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LastModifiedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LastModifiedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LastModifiedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -}